From cffeecee26425ecfcf0f77624378004eb33c446c Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 26 Oct 2021 03:11:55 -0700 Subject: [PATCH] fix #K3474 - "you detect it where was" A vampire in bat form was seen via infravision or possibly telepathy, then when it changed into fog cloud form the feedback was |You now detect it where the vampire bat was. The message substitutes "detect" for "see" when the new form can't be seen and the monster name formatting yields "it" for that case. Give a vanish message instead since that is effectively what happens. --- doc/fixes37.0 | 2 ++ src/monmove.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 040a38460..84b0d03b6 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -662,6 +662,8 @@ have applying a polearm give feedback similar to 'F' for melee weapon when attacking a wall or boulder if weight_cap() ever returned 0 (which probably can't happen), using #untrap to pull a monster out of a pit would trigger a divide by 0 crash +avoid "you now detect it where the vampire bat was" when a vampire shifts from + a bat seen with infravision to an unseen fog cloud Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/monmove.c b/src/monmove.c index e64b76469..b9426a444 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1907,6 +1907,7 @@ vamp_shift( { int reslt = 0; char oldmtype[BUFSZ]; + boolean sawmon = canseemon(mon); /* before shape change */ /* remember current monster type before shapechange */ Strcpy(oldmtype, domsg ? noname_monnam(mon, ARTICLE_THE) : ""); @@ -1920,9 +1921,14 @@ vamp_shift( } if (reslt && domsg) { - pline("You %s %s where %s was.", - !canseemon(mon) ? "now detect" : "observe", - noname_monnam(mon, ARTICLE_A), oldmtype); + /* might have seen vampire/bat/wolf with infravision then be + unable to see the same creature when it turns into a fog cloud */ + if (canspotmon(mon)) + You("%s %s where %s was.", + !canseemon(mon) ? "now detect" : "observe", + noname_monnam(mon, ARTICLE_A), oldmtype); + else + You("can no longer %s %s.", sawmon ? "see" : "sense", oldmtype); /* this message is given when it turns into a fog cloud in order to move under a closed door */ display_nhwindow(WIN_MESSAGE, FALSE);