From: PatR Date: Tue, 27 Jul 2021 18:58:44 +0000 (-0700) Subject: gaze vs hider X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3712dbb312b2930bbc3a0b2c6442f1eaf2fd958;p=nethack gaze vs hider From a 7 or 8 year old bug report from a beta tester. A pyrolisk's gaze against a mimic didn't unhide that mimic. Somewhere along the line that has been fixed, but some apparently redundant code inside 'if (visible)' should be done even when not visible. --- diff --git a/src/mhitm.c b/src/mhitm.c index cda45a8f6..3243fa130 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mhitm.c $NHDT-Date: 1625838646 2021/07/09 13:50:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.198 $ */ +/* NetHack 3.7 mhitm.c $NHDT-Date: 1627412283 2021/07/27 18:58:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.199 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -636,9 +636,13 @@ gazemm(struct monst *magr, struct monst *mdef, struct attack *mattk) && mattk->adtyp == AD_BLND), altmesg = (archon && !magr->mcansee); + /* bring target out of hiding even if hero doesn't see it happen (this + is already done in pre_mm_attack() and shouldn't be needed here) */ + if (mdef->data->mlet == S_MIMIC && M_AP_TYPE(mdef) != M_AP_NOTHING) + seemimic(mdef); + mdef->mundetected = 0; + if (g.vis) { - if (mdef->data->mlet == S_MIMIC && M_AP_TYPE(mdef) != M_AP_NOTHING) - seemimic(mdef); Sprintf(buf, "%s gazes %s", altmesg ? Adjmonnam(magr, "blinded") : Monnam(magr), altmesg ? "toward" : "at");