From ebef31ffa5026f54dbc9cf960016efeb0a539c3e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 17 Nov 2018 19:48:48 +0200 Subject: [PATCH] Check monster relocation degenerate cases more strictly Just in case we're trying to put the monster on the same location where it already thinks it is... but actually isn't. --- src/mon.c | 2 +- src/teleport.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mon.c b/src/mon.c index 7340e1ad6..232992d32 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2586,7 +2586,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */ xchar newx, newy; coord mm; - if (mtmp->mx == x && mtmp->my == y) + if (mtmp->mx == x && mtmp->my == y && m_at(x,y) == mtmp) return TRUE; if (move_other && (othermon = m_at(x, y)) != 0) { diff --git a/src/teleport.c b/src/teleport.c index 9a6ff8f19..a7901e3d9 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1005,8 +1005,8 @@ register int x, y; register int oldx = mtmp->mx, oldy = mtmp->my; boolean resident_shk = mtmp->isshk && inhishop(mtmp); - if (x == mtmp->mx && y == mtmp->my) /* that was easy */ - return; + if (x == mtmp->mx && y == mtmp->my && m_at(x,y) == mtmp) + return; /* that was easy */ if (oldx) { /* "pick up" monster */ if (mtmp->wormno) { -- 2.40.0