From 02749b762123eb60e76b82122dfeabccedc4ddf5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 22 Nov 2018 20:24:56 +0200 Subject: [PATCH] Fix guard shoving monsters away coordinate logic The logic required both x and y coordinates of the guard location and the new location the guard wanted to move to be different. This is obviously wrong, as the guard may move horizontally or vertically. --- src/vault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vault.c b/src/vault.c index 1947aa75b..7e47577e2 100644 --- a/src/vault.c +++ b/src/vault.c @@ -585,10 +585,10 @@ gd_mv_monaway(grd, nx,ny) register struct monst *grd; int nx,ny; { - if (MON_AT(nx, ny) && nx != grd->mx && ny != grd->my) { + if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) { if (!Deaf) verbalize("Out of my way, scum!"); - if (!rloc(m_at(nx, ny), FALSE) || m_at(nx, ny)) + if (!rloc(m_at(nx, ny), FALSE) || MON_AT(nx, ny)) m_into_limbo(m_at(nx, ny)); } } -- 2.40.0