]> granicus.if.org Git - nethack/commitdiff
Fix dead mon and guard sanity checking
authorPasi Kallinen <paxed@alt.org>
Mon, 18 Apr 2016 16:52:54 +0000 (19:52 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 18 Apr 2016 16:52:54 +0000 (19:52 +0300)
src/mon.c

index 2e339152d44424c5cc1e8bb819d7207713328326..d5ac2e0bb1bc6976c6e232d719fc0457e07f64c2 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -84,8 +84,10 @@ mon_sanity_check()
 
     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
         sanity_check_single_mon(mtmp, TRUE, "fmon");
+        if (DEADMONSTER(mtmp))
+            continue;
         x = mtmp->mx, y = mtmp->my;
-        if (!isok(x, y) || (x == 0 && !mtmp->isgd))
+        if (!isok(x, y) && !(mtmp->isgd && x == 0 && y == 0))
             impossible("mon (%s) claims to be at <%d,%d>?",
                        fmt_ptr((genericptr_t) mtmp), x, y);
         else if (level.monsters[x][y] != mtmp)