fix part of #H9467 - clairvoyance vs sensed mons

When a monster is drawn on the map, remove any "remembered, unseen
monster" glyph being shown at the same spot.  Clairvoyance shows
all monsters in vicinty, then ones which can't be seen are replaced
with the 'I' glyph (which is on the object layer or the display,
not the monster layer show is subject to different update behavior).
But subsequent monster refresh didn't get rid of it when a sensed
monster was displayed over it.  (3.6.1 included a similar fix for
warned-of monsters.)

Also during clairvoyance, don't draw an 'I' at a spot that will
immediately be refreshed with a monster because 'I' clobbers any
remembered object at the same location.
This commit is contained in:
PatR
2019-11-27 11:24:23 -08:00
parent cc3152dc9a
commit 0c98a30b8d
3 changed files with 40 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 detect.c $NHDT-Date: 1562630266 2019/07/08 23:57:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.96 $ */
/* NetHack 3.6 detect.c $NHDT-Date: 1574882659 2019/11/27 19:24:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.99 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1416,8 +1416,13 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
continue;
newglyph = glyph_at(zx, zy);
if (glyph_is_monster(newglyph)
&& glyph_to_mon(newglyph) != PM_LONG_WORM_TAIL)
map_invisible(zx, zy);
&& glyph_to_mon(newglyph) != PM_LONG_WORM_TAIL) {
/* map_invisible() was unconditional here but that made
remembered objects be forgotten for the case where a
monster is immediately redrawn by see_monsters() */
if ((mtmp = m_at(zx, zy)) == 0 || !canspotmon(mtmp))
map_invisible(zx, zy);
}
}
see_monsters();