]> granicus.if.org Git - nethack/commitdiff
Fire trap on ice can indirectly kill a monster via drowning
authorPasi Kallinen <paxed@alt.org>
Sun, 29 May 2022 06:42:25 +0000 (09:42 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 5 Jul 2022 09:17:50 +0000 (12:17 +0300)
Make the trap routine claim the trap killed the monster even
though it was drowning that did it, otherwise callers cannot
rely on the trap routine return value.

src/trap.c

index 6f46d6942c78def66e7281fee84253481abf215b..00ff3e17e4ef0d8e114070463784affa8d6c0e14 100644 (file)
@@ -1533,6 +1533,8 @@ trapeffect_fire_trap(
             You("smell smoke.");
         if (is_ice(tx, ty))
             melt_ice(tx, ty, (char *) 0);
+        if (DEADMONSTER(mtmp))
+            trapkilled = TRUE;
         if (see_it && t_at(tx, ty))
             seetrap(t_at(tx, ty));