crushed to death by a gas spore's explosion

From the newsgroup, remarking on an usual cause of death seen at NAO.
Surviving a gas spore's explosion (via hit points, not from life-saving)
left "gas spore's explosion" as stale killer.name.  Being killed by
opening a drawbridge (but not by closing or breaking one) only assigned
killer.name if it didn't already have a value, so the stale reason got
used:  crushed to death by a gas spore's explosion.

This fixes it two ways:  clear the stale value after surviving the
explosion, and assign a specific reason when opening the drawbridge.

This also removes stale reason for death set up by various drawbridge
activity.  For the usual case, the hero only survives by life-saving
which does its own clearing of killer.name.  But there might have been
cases where it was being set for the hero when operating on a monster,
so no life-saving involved.  The drawbridge code is not the easiest
code to navigate....
This commit is contained in:
PatR
2017-08-21 15:50:36 -07:00
parent eadecb1baf
commit 0ad33783f0
4 changed files with 31 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1502753408 2017/08/14 23:30:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.242 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1503355818 2017/08/21 22:50:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.243 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1994,6 +1994,8 @@ boolean was_swallowed; /* digestion */
Sprintf(killer.name, "%s explosion", s_suffix(mdat->mname));
killer.format = KILLED_BY_AN;
explode(mon->mx, mon->my, -1, tmp, MON_EXPLODE, EXPL_NOXIOUS);
killer.name[0] = '\0';
killer.format = 0;
return FALSE;
}
}