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.
This commit is contained in:
Pasi Kallinen
2022-03-05 11:26:39 +02:00
parent fa40cc9e3a
commit 4c1d1a0666

View File

@@ -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);
}