From 7a1db1d0bd2e9fe71f67fa97fb726f691d3481f9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 4 Mar 2022 19:58:17 +0200 Subject: [PATCH] Fix couple cases of unhiding monsters Hidden monster might be forced to move to a location where it can't hide, perhaps because it's mostly surrounded by other monsters. Hidden monster in a pit under items, getting hit by a rolling boulder, the boulder will fill the pit burying the items, making the monster unable to hide there. --- src/dig.c | 1 + src/monmove.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/dig.c b/src/dig.c index 97f4b1f9b..29dc38b84 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1908,6 +1908,7 @@ bury_objs(int x, int y) /* don't expect any engravings here, but just in case */ del_engr_at(x, y); newsym(x, y); + maybe_unhide_at(x, y); if (costly && loss) { You("owe %s %ld %s for burying merchandise.", shkname(shkp), loss, diff --git a/src/monmove.c b/src/monmove.c index 9b5803123..4aa66a264 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1421,6 +1421,8 @@ m_move(register struct monst* mtmp, register int after) if (mtmp->wormno) worm_move(mtmp); + maybe_unhide_at(mtmp->mx, mtmp->my); + for (j = MTSZ - 1; j > 0; j--) mtmp->mtrack[j] = mtmp->mtrack[j - 1]; mtmp->mtrack[0].x = omx;