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 explode.c $NHDT-Date: 1496103440 2017/05/30 00:17:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
/* NetHack 3.6 explode.c $NHDT-Date: 1503355817 2017/08/21 22:50:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.50 $ */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -90,7 +90,9 @@ int expltype;
if (olet == MON_EXPLODE) {
str = killer.name;
do_hallu = Hallucination && strstri(str, "'s explosion");
do_hallu = (Hallucination
&& (strstri(str, "'s explosion")
|| strstri(str, "s' explosion")));
adtyp = AD_PHYS;
} else
switch (abs(type) % 10) {