]> granicus.if.org Git - nethack/commitdiff
Untrap monster in trap on melting ice
authorPasi Kallinen <paxed@alt.org>
Wed, 6 Jul 2022 17:16:12 +0000 (20:16 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 6 Jul 2022 17:16:24 +0000 (20:16 +0300)
Monster trapped in a trap on melting ice, the monster stayed
trapped even as the trap was removed when the ice melted.

src/trap.c

index 00ff3e17e4ef0d8e114070463784affa8d6c0e14..85ad82b743c5b22ab99eb06f3d2409aac58a2008 100644 (file)
@@ -6245,6 +6245,10 @@ trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting)
     struct trap *ttmp = t_at(x, y);
 
     if (ttmp && ice_is_melting) {
+        struct monst *mtmp;
+
+        if (((mtmp = m_at(x, y)) != 0) && mtmp->mtrapped)
+            mtmp->mtrapped = 0;
         if (ttmp->ttyp == LANDMINE || ttmp->ttyp == BEAR_TRAP) {
             /* landmine or bear trap set on top of the ice falls
                into the water */