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.
This commit is contained in:
PatR
2021-07-27 11:58:44 -07:00
parent b4d0d6fa58
commit e3712dbb31

View File

@@ -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");