]> granicus.if.org Git - nethack/commitdiff
More trap sanity
authorPasi Kallinen <paxed@alt.org>
Fri, 4 Mar 2022 15:18:05 +0000 (17:18 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 4 Mar 2022 15:18:05 +0000 (17:18 +0200)
src/trap.c

index 4aa7125d1488dd713b370d8a90377fe684fe05da..2e76b04562ecda3be46eb8cbd5749660d313dbf9 100644 (file)
@@ -6134,9 +6134,9 @@ trap_sanity_check(void)
 
     while (ttmp) {
         if (!isok(ttmp->tx, ttmp->ty))
-            impossible("trap sanity: location");
-        if (ttmp->ttyp < 0 || ttmp->ttyp >= TRAPNUM)
-            impossible("trap sanity: type");
+            impossible("trap sanity: location (%i,%i)", ttmp->tx, ttmp->ty);
+        if (ttmp->ttyp <= NO_TRAP || ttmp->ttyp >= TRAPNUM)
+            impossible("trap sanity: type (%i)", ttmp->ttyp);
         ttmp = ttmp->ntrap;
     }
 }