create monster creating concealed mimic

From an old bug report (sent directly to devteam, June of 2017):
wand or scroll of create monster becomes discovered if it makes
a mimic that is concealed as an object or as furniture within
the hero's view.  Fixing this in the general case [when does
seeing a mimic as something other than a monster mean that the
mimic is being seen?] is a massive can of worms, but fixing this
specific case is trivial.
This commit is contained in:
PatR
2020-11-20 18:56:35 -08:00
parent f7a3e7884c
commit 03d7d64d15
3 changed files with 17 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 display.h $NHDT-Date: 1597700875 2020/08/17 21:47:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.47 $ */
/* NetHack 3.7 display.h $NHDT-Date: 1605927391 2020/11/21 02:56:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.48 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -69,6 +69,15 @@ enum explosion_types {
* hero can physically see the location of the monster. The function
* vobj_at() returns a pointer to an object that the hero can see there.
* Infravision is not taken into account.
*
* Note: not reliable for concealed mimics. They don't have
* 'mon->mundetected' set even when mimicking objects or furniture.
* [Fixing this with a pair of mon->m_ap_type checks here (via either
* 'typ!=object && typ!=furniture' or 'typ==nothing || typ==monster')
* will require reviewing every instance of mon_visible(), canseemon(),
* canspotmon(), is_safemon() and perhaps others. Fixing it by setting
* mon->mundetected when concealed would be better but also require
* reviewing all those instances and also existing mundetected instances.]
*/
#if 0
#define mon_visible(mon) \