fix #H254 - stethocoping mimics (trunk only)

From a bug report, applying a stetoscope to
a mimic which was hiding would report that mimic's stats but not bring it
out of hiding, unlike the behavior for other types of hiding monsters.
This commit is contained in:
nethack.rankin
2007-03-08 05:42:15 +00:00
parent 2867248f49
commit b8a51d3649
2 changed files with 28 additions and 4 deletions
+1
View File
@@ -193,6 +193,7 @@ scatter piles of kicked gold rather than move the entire pile at once
if normal game save file is restored via `nethack -X', restore in normal if normal game save file is restored via `nethack -X', restore in normal
mode--with save file deletion--and require confirmation ala 'X' mode--with save file deletion--and require confirmation ala 'X'
command to make deferred switch into explore mode command to make deferred switch into explore mode
stethoscope applied to hiding mimic will bring it out of hiding
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+27 -4
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)apply.c 3.5 2007/02/03 */ /* SCCS Id: @(#)apply.c 3.5 2007/03/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -344,11 +344,34 @@ use_stethoscope(obj)
return 0; return 0;
} }
if ((mtmp = m_at(rx,ry)) != 0) { if ((mtmp = m_at(rx,ry)) != 0) {
mstatusline(mtmp); const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *)0,
SUPPRESS_IT|SUPPRESS_INVISIBLE, FALSE);
if (mtmp->mundetected) { if (mtmp->mundetected) {
mtmp->mundetected = 0; if (!canspotmon(mtmp))
if (cansee(rx,ry)) newsym(mtmp->mx,mtmp->my); There("is %s hidden there.", mnm);
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
} else if (mtmp->mappearance) {
const char *what = "thing";
switch (mtmp->m_ap_type) {
case M_AP_OBJECT:
what = simple_typename(mtmp->mappearance);
break;
case M_AP_MONSTER: /* ignore Hallucination here */
what = mons[mtmp->mappearance].mname;
break;
case M_AP_FURNITURE:
what = defsyms[mtmp->mappearance].explanation;
break;
}
seemimic(mtmp);
pline("That %s is really %s", what, mnm);
} else if (flags.verbose && !canspotmon(mtmp)) {
There("is %s there.", mnm);
} }
mstatusline(mtmp);
if (!canspotmon(mtmp)) if (!canspotmon(mtmp))
map_invisible(rx,ry); map_invisible(rx,ry);
return res; return res;