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 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.356 $ $NHDT-Date: 1605726848 2020/11/18 19:14:08 $ NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.357 $ $NHDT-Date: 1605927391 2020/11/21 02:56:31 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -300,6 +300,9 @@ since ki-rin look quite a bit like unicorns, make them be more like one:
allow them to use their own horn to cure themselves; remove M1_ANIMAL, allow them to use their own horn to cure themselves; remove M1_ANIMAL,
change MS_NEIGH to MS_SPELL, add MR_POISON; they're still 'A' rather change MS_NEIGH to MS_SPELL, add MR_POISON; they're still 'A' rather
than 'u' and don't care about gems than 'u' and don't care about gems
wand or scroll of create monster that makes a new monster which can be seen
or sensed becomes discovered but was doing so even for a concealed
mimic seen as furniture or an object
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

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 */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */ /* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */ /* 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 * 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. * vobj_at() returns a pointer to an object that the hero can see there.
* Infravision is not taken into account. * 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 #if 0
#define mon_visible(mon) \ #define mon_visible(mon) \

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 makemon.c $NHDT-Date: 1596498176 2020/08/03 23:42:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.177 $ */ /* NetHack 3.7 makemon.c $NHDT-Date: 1605927392 2020/11/21 02:56:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1503,7 +1503,8 @@ boolean neverask;
x = c.x, y = c.y; x = c.x, y = c.y;
mon = makemon(mptr, x, y, NO_MM_FLAGS); mon = makemon(mptr, x, y, NO_MM_FLAGS);
if (mon && canspotmon(mon)) if (mon && canspotmon(mon) && (M_AP_TYPE(mon) == M_AP_NOTHING
|| M_AP_TYPE(mon) == M_AP_MONSTER))
known = TRUE; known = TRUE;
} }
return known; return known;