]> granicus.if.org Git - nethack/commitdiff
Fix monster booted into limbo trying to act
authorPasi Kallinen <paxed@alt.org>
Tue, 7 Apr 2020 14:23:18 +0000 (17:23 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 7 Apr 2020 14:23:23 +0000 (17:23 +0300)
There's a chance that a tactics-using monster (eg. arch-lich)
teleporting next to you on a full level would get booted off
into limbo. After that, if the monster tried using an item
in the same action you'd get panic "relmon: mon not in list"

Fix this particular case by checking monster mstate.
Other cases may lurk in other places that eventually call mnexto.

src/monmove.c

index 65433ed71ed0ed5f816fffa67dc1277fd28d0970..26e848c8edb29bbff832bfb840b7aab4a1bc5ed5 100644 (file)
@@ -503,8 +503,12 @@ register struct monst *mtmp;
 
     /* Monsters that want to acquire things */
     /* may teleport, so do it before inrange is set */
-    if (is_covetous(mdat))
+    if (is_covetous(mdat)) {
         (void) tactics(mtmp);
+        /* tactics -> mnexto -> deal_with_overcrowding */
+        if (mtmp->mstate)
+            return 0;
+    }
 
     /* check distance and scariness of attacks */
     distfleeck(mtmp, &inrange, &nearby, &scared);