From: PatR Date: Wed, 6 Jan 2016 01:29:36 +0000 (-0800) Subject: fix #H4179 - death reason for rotted globs X-Git-Tag: NetHack-3.6.1_RC01~1064^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de5ed30cd7cadcaabbbc6553c9ffcddce7a397d2;p=nethack fix #H4179 - death reason for rotted globs 'Poisoned by a rotted gray ooze corpse' should have been 'Poisoned by a rotted glob of gray ooze'. eatcorpse() is called for non-corpse globs and then corpse_xname() is called for them too to set up death reason for make_sick(), but it didn't know anything about globs. Now it does. Blob size is ignored since it's not relevant for cause of death. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 16f77f7e7..dbbc0b0a6 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -88,6 +88,7 @@ make mimics mimicing walls or trees also block light stepping onto lava destroyed non-fireproof water walking boots but left other vulnerable boot types intact allow moving cursor to monsters with 'm' and 'M' when asked for map location +fix death reason when eating tainted glob of (not corpse) Platform- and/or Interface-Specific Fixes diff --git a/src/objnam.c b/src/objnam.c index 339a478a5..5dc1e8c2e 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1451683056 2016/01/01 21:17:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.162 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1452043772 2016/01/06 01:29:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.163 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1102,6 +1102,8 @@ register struct obj *otmp; || is_flammable(otmp)); } +/* format a corpse name (xname() omits monster type; doname() calls us); + eatcorpse() also uses us for death reason when eating tainted glob */ char * corpse_xname(otmp, adjective, cxn_flags) struct obj *otmp; @@ -1118,10 +1120,14 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ /* include "an" for "an ogre corpse */ any_prefix = (cxn_flags & CXN_ARTICLE) != 0, /* leave off suffix (do_name() appends "corpse" itself) */ - omit_corpse = (cxn_flags & CXN_NOCORPSE) != 0, possessive = FALSE; + omit_corpse = (cxn_flags & CXN_NOCORPSE) != 0, + possessive = FALSE, + glob = (otmp->otyp != CORPSE && otmp->globby); const char *mname; - if (omndx == NON_PM) { /* paranoia */ + if (glob) { + mname = OBJ_NAME(objects[otmp->otyp]); /* "glob of " */ + } else if (omndx == NON_PM) { /* paranoia */ mname = "thing"; /* [Possible enhancement: check whether corpse has monster traits attached in order to use priestname() for priests and minions.] */ @@ -1172,7 +1178,9 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ any_prefix = FALSE; } - if (!omit_corpse) { + if (glob) { + ; /* omit_corpse doesn't apply; quantity is always 1 */ + } else if (!omit_corpse) { Strcat(nambuf, " corpse"); /* makeplural(nambuf) => append "s" to "corpse" */ if (otmp->quan > 1L && !ignore_quan) {