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.
This commit is contained in:
Pasi Kallinen
2018-11-17 19:48:48 +02:00
parent 878ac24037
commit ebef31ffa5
2 changed files with 3 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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) {