]> granicus.if.org Git - nethack/commitdiff
Fix couple cases of unhiding monsters
authorPasi Kallinen <paxed@alt.org>
Fri, 4 Mar 2022 17:58:17 +0000 (19:58 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 4 Mar 2022 17:58:24 +0000 (19:58 +0200)
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
src/monmove.c

index 97f4b1f9b674765a511bcfcbde618ab42fdb5eb9..29dc38b845915e7fa8133d0b0174ff6f184c2c6e 100644 (file)
--- 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,
index 9b5803123e98ca6cd0f1647b754ea25e643e59e4..4aa66a264c740199079367aad41807a9293d8a93 100644 (file)
@@ -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;