]> granicus.if.org Git - nethack/commitdiff
Fix monster trapped in nonexistent trap, pt 2
authorPasi Kallinen <paxed@alt.org>
Sat, 5 Mar 2022 11:42:24 +0000 (13:42 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 5 Mar 2022 11:42:28 +0000 (13:42 +0200)
Monster hiding under an item on a location with a land mine,
a rolling boulder trap launches a boulder which blows up the mine,
and all the items scatter away. If the hider survived that, it
was still hiding.

src/explode.c

index 661eb1c1641811321c7244101ed25a1d089e08f9..6effc7523a6c496de8ad74c5adc36cc22d294797 100644 (file)
@@ -840,6 +840,8 @@ scatter(int sx, int sy,  /* location of objects to scatter */
     newsym(sx, sy);
     if (u_at(sx, sy) && u.uundetected && hides_under(g.youmonst.data))
         (void) hideunder(&g.youmonst);
+    if (((mtmp = m_at(sx, sy)) != 0) && mtmp->mtrapped)
+        mtmp->mtrapped = 0;
     if (lostgoods) /* implies shop_origin and therefore shkp valid */
         credit_report(shkp, 1, FALSE);
     return total;