From: PatR Date: Sun, 4 Jun 2017 00:05:40 +0000 (-0700) Subject: vampshifting fog could vs door X-Git-Tag: NetHack-3.6.1_RC01~483 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d8269a8818b0d4015bf5c6b88dcbebf6ead7365;p=nethack vampshifting fog could vs door Noticed while composing a reply to the #H5547 report about named vampire shape-shift message. The message when a vampire (possibly in vampire bat form) turned into a fog cloud in order to pass under a closed door was using a stale cached mon->data value when choosing the verb. So normal fog cloud or vampire already in fog cloud shape would "flow" under the door, but newly shifted fog cloud would "ooze" under the door. I saw this while testing the previous patch but its significance didn't register at the time. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 5f13a649c..d010c2541 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -391,6 +391,7 @@ poor message when shape-shifted vampire reverts if cause of 'death' was used for amorphous form, "reconstitute" rather than "transform") poor message when named vampire shifts shape within view: You observe a Dracula where a Dracula was. +vampire shifting into fog cloud to pass under door "oozed" rather than "flowed" adult green dragons and the Chromatic Dragon were blinded by gas clouds diff --git a/src/monmove.c b/src/monmove.c index ece138bba..92cdac8dd 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 monmove.c $NHDT-Date: 1496531115 2017/06/03 23:05:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.90 $ */ +/* NetHack 3.6 monmove.c $NHDT-Date: 1496534703 2017/06/04 00:05:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1250,10 +1250,12 @@ postmov: || (can_fog(mtmp) && vamp_shift(mtmp, &mons[PM_FOG_CLOUD], canspotmon(mtmp))))) { + /* update cached value for vamp_shift() case */ + ptr = mtmp->data; if (flags.verbose && canseemon(mtmp)) pline("%s %s under the door.", Monnam(mtmp), (ptr == &mons[PM_FOG_CLOUD] - || ptr == &mons[PM_YELLOW_LIGHT]) + || ptr->mlet == S_LIGHT) ? "flows" : "oozes"); } else if (here->doormask & D_LOCKED && can_unlock) {