From: Pasi Kallinen Date: Sat, 5 Mar 2022 09:26:39 +0000 (+0200) Subject: Fix monster trapped in nonexistent trap X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c1d1a0666893f037f46d7f638cd21f1655403fe;p=nethack Fix monster trapped in nonexistent trap A monster trapped in a bear trap on ice, exploding fiery monster turned the ice into water turning the trap into object, the trapped monster claimed to be still trapped in the nonexistent trap. --- diff --git a/src/trap.c b/src/trap.c index ebc3e78e0..deeab493f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4500,6 +4500,7 @@ cnv_trap_obj( boolean bury_it) { struct obj *otmp = mksobj(otyp, TRUE, FALSE); + struct monst *mtmp; otmp->quan = cnt; otmp->owt = weight(otmp); @@ -4519,6 +4520,8 @@ cnv_trap_obj( newsym(ttmp->tx, ttmp->ty); if (u.utrap && u_at(ttmp->tx, ttmp->ty)) reset_utrap(TRUE); + if (((mtmp = m_at(ttmp->tx, ttmp->ty)) != 0) && mtmp->mtrapped) + mtmp->mtrapped = 0; deltrap(ttmp); }