]> granicus.if.org Git - nethack/commitdiff
Untrap monster when lregion removes the trap
authorPasi Kallinen <paxed@alt.org>
Thu, 7 Jul 2022 09:27:28 +0000 (12:27 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 7 Jul 2022 09:29:03 +0000 (12:29 +0300)
This check really should go in deltrap itself, but that would require
more effort than I have spoons for right now.

src/mkmaze.c

index ff943666bcd772f721e7172689fa61c700d7643e..169532ef37f9cf965828a7d23e62df02c7d52e5e 100644 (file)
@@ -366,8 +366,11 @@ put_lregion_here(
                It might still fail if there's a dungeon feature here. */
             struct trap *t = t_at(x, y);
 
-            if (t && !undestroyable_trap(t->ttyp))
+            if (t && !undestroyable_trap(t->ttyp)) {
+                if (((mtmp = m_at(x, y)) != 0) && mtmp->mtrapped)
+                    mtmp->mtrapped = 0;
                 deltrap(t);
+            }
             if (bad_location(x, y, nlx, nly, nhx, nhy))
                 return FALSE;
         }