unhiding during summoning

According to a newsgroup followup, a hidden pet summoned via magic
whistle could produce the same effect as the level change case (where
sometimes the glyph for unseen monster would appear unexpectedly).  I was
unable to reproduce this one, but I don't see anything in the code to deal
with the situation, so I suspect that the monster is moving immediately
and being revealed before I have a chance to notice anything odd.

     I assume that other situations where hidden monsters get teleported
are being handled as attacks which expose them.  At least I hope so.
This commit is contained in:
nethack.rankin
2006-10-22 03:53:50 +00:00
parent 6b371a7042
commit f3a5f4e61d
2 changed files with 13 additions and 5 deletions

View File

@@ -263,7 +263,7 @@ try harder to keep dragged chain between ball and hero
fireproof containers should not burn in lava
fix invalid pointer dereference after applying a wielded cream pie
avoid drowned in a drowning and burned by burning if life-saving is inadequate
hidden monsters who change levels come out of hiding in the process
reveal hidden monsters who change levels or are magically summoned
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)apply.c 3.5 2006/07/08 */
/* SCCS Id: @(#)apply.c 3.5 2006/10/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -409,7 +409,8 @@ struct obj *obj;
Underwater ? "very " : "");
wake_nearby();
} else {
int pet_cnt = 0;
int pet_cnt = 0, omx, omy;
/* it's magic! it works underwater too (at a higher pitch) */
You(whistle_str, Hallucination ? "normal" :
Underwater ? "strange, high-pitched" : "strange");
@@ -422,9 +423,16 @@ struct obj *obj;
mtmp->mtrapped = 0;
fill_pit(mtmp->mx, mtmp->my);
}
/* mimic must be revealed before we know whether it
actually moves because line-of-sight may change */
if (mtmp->m_ap_type) seemimic(mtmp);
omx = mtmp->mx, omy = mtmp->my;
mnexto(mtmp);
if (canspotmon(mtmp)) ++pet_cnt;
if (mintrap(mtmp) == 2) change_luck(-1);
if (mtmp->mx != omx || mtmp->my != omy) {
mtmp->mundetected = 0; /* reveal non-mimic hider */
if (canspotmon(mtmp)) ++pet_cnt;
if (mintrap(mtmp) == 2) change_luck(-1);
}
}
}
if (pet_cnt > 0) makeknown(obj->otyp);