B02002 - drawbridge vs longworm

If a long worm's head is on the drawbridge and a tail segment is at the
portcullis and you raise the drawbridge, bad monster handling occurs
because of some recursion that occurs before set_entity is called again.
Not sure when this last worked; it's broken in 3.4.2 as well.  Modified
e_died to ensure both entity objects for the same monster get cleaned up
so subsequent e_at calls behave as expected.
This commit is contained in:
cohrs
2003-11-27 17:37:38 +00:00
parent 70e25fa154
commit 5b74be68fe
2 changed files with 10 additions and 0 deletions

View File

@@ -399,6 +399,8 @@ int dest, how;
/* we might have crawled out of the moat to survive */
etmp->ex = u.ux, etmp->ey = u.uy;
} else {
int entitycnt;
killer.name[0] = 0;
/* fake "digested to death" damage-type suppresses corpse */
#define mk_message(dest) ((dest & 1) ? "" : (char *)0)
@@ -409,6 +411,13 @@ int dest, how;
else /* you caused it */
xkilled(etmp->emon, dest);
etmp->edata = (struct permonst *)0;
/* dead long worm handling */
for (entitycnt = 0; entitycnt < ENTITIES; entitycnt++) {
if (etmp != &(occupants[entitycnt]) &&
etmp->emon == occupants[entitycnt].emon)
occupants[entitycnt].edata = (struct permonst *)0;
}
#undef mk_message
#undef mk_corpse
}