From 9114a334c985e5d904f210b4884f25e4e8cfb782 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 23 Dec 2015 16:05:45 -0800 Subject: [PATCH] fix "killed by a died" Explosion caused by an unseen gas spore resulted in messages about "explosion" instead of "gas spore's explosion", which is intended, but followed that with a death reason of "killed by a died" which isn't. --- doc/fixes36.1 | 1 + src/explode.c | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 5fea268c6..e5e62f723 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -54,6 +54,7 @@ make travel walk up to a trap and stop when the trap blocks the only way forward, instead of trying to go straight line travel will displace pets rather than stop do not autopickup unpaid items in shops +death due an unseen gas spore's explosion resulted in "killed by a died" Platform- and/or Interface-Specific Fixes diff --git a/src/explode.c b/src/explode.c index 08a9a704e..0c736a7f9 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 explode.c $NHDT-Date: 1446955298 2015/11/08 04:01:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */ +/* NetHack 3.6 explode.c $NHDT-Date: 1450915435 2015/12/24 00:03:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.45 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -311,12 +311,13 @@ int expltype; so avoid any which begins with a capital letter) */ do { Sprintf(hallu_buf, "%s explosion", - s_suffix(rndmonnam(NULL))); + s_suffix(rndmonnam((char *) 0))); } while (*hallu_buf != lowc(*hallu_buf)); str = hallu_buf; } if (u.uswallow && mtmp == u.ustuck) { - const char *adj = NULL; + const char *adj = (char *) 0; + if (is_animal(u.ustuck->data)) { switch (adtyp) { case AD_FIRE: @@ -431,7 +432,7 @@ int expltype; if (do_hallu) { /* (see explanation above) */ do { Sprintf(hallu_buf, "%s explosion", - s_suffix(rndmonnam(NULL))); + s_suffix(rndmonnam((char *) 0))); } while (*hallu_buf != lowc(*hallu_buf)); str = hallu_buf; } @@ -468,9 +469,8 @@ int expltype; rehumanize(); } else { if (olet == MON_EXPLODE) { - /* killer handled by caller */ - if (generic) - killer.name[0] = 0; + if (generic) /* explosion was unseen; str=="explosion", */ + ; /* killer.name=="gas spore's explosion" */ else if (str != killer.name && str != hallu_buf) Strcpy(killer.name, str); killer.format = KILLED_BY_AN; @@ -486,8 +486,7 @@ int expltype; Strcpy(killer.name, str); } if (iflags.last_msg == PLNMSG_CAUGHT_IN_EXPLOSION - || iflags.last_msg - == PLNMSG_TOWER_OF_FLAME) /*seffects()*/ + || iflags.last_msg == PLNMSG_TOWER_OF_FLAME) /*seffects()*/ pline("It is fatal."); else pline_The("%s is fatal.", str);