From 5b74be68fe548b10e58ee947fb8a7575b6ee87a1 Mon Sep 17 00:00:00 2001 From: cohrs Date: Thu, 27 Nov 2003 17:37:38 +0000 Subject: [PATCH] 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. --- doc/fixes34.3 | 1 + src/dbridge.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 5233a7556..bec10e46e 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -95,6 +95,7 @@ resuming interrupted 'A' sometimes ended with "You finished disrobing" twice when you're asleep you shouldn't "notice" monsters that have become undetected must be able to reach floor in order to use stethoscope on corpse or statue fix a few coordinate (y,y) -> (x,y) typos in apply.c, mon.c, and wizard.c +killing a long worm on a drawbridge could produce a panic Platform- and/or Interface-Specific Fixes diff --git a/src/dbridge.c b/src/dbridge.c index 53b987825..fa7020e5d 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -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 }