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:
@@ -263,7 +263,7 @@ try harder to keep dragged chain between ball and hero
|
|||||||
fireproof containers should not burn in lava
|
fireproof containers should not burn in lava
|
||||||
fix invalid pointer dereference after applying a wielded cream pie
|
fix invalid pointer dereference after applying a wielded cream pie
|
||||||
avoid drowned in a drowning and burned by burning if life-saving is inadequate
|
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
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
16
src/apply.c
16
src/apply.c
@@ -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. */
|
/* 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. */
|
||||||
|
|
||||||
@@ -409,7 +409,8 @@ struct obj *obj;
|
|||||||
Underwater ? "very " : "");
|
Underwater ? "very " : "");
|
||||||
wake_nearby();
|
wake_nearby();
|
||||||
} else {
|
} else {
|
||||||
int pet_cnt = 0;
|
int pet_cnt = 0, omx, omy;
|
||||||
|
|
||||||
/* it's magic! it works underwater too (at a higher pitch) */
|
/* it's magic! it works underwater too (at a higher pitch) */
|
||||||
You(whistle_str, Hallucination ? "normal" :
|
You(whistle_str, Hallucination ? "normal" :
|
||||||
Underwater ? "strange, high-pitched" : "strange");
|
Underwater ? "strange, high-pitched" : "strange");
|
||||||
@@ -422,9 +423,16 @@ struct obj *obj;
|
|||||||
mtmp->mtrapped = 0;
|
mtmp->mtrapped = 0;
|
||||||
fill_pit(mtmp->mx, mtmp->my);
|
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);
|
mnexto(mtmp);
|
||||||
if (canspotmon(mtmp)) ++pet_cnt;
|
if (mtmp->mx != omx || mtmp->my != omy) {
|
||||||
if (mintrap(mtmp) == 2) change_luck(-1);
|
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);
|
if (pet_cnt > 0) makeknown(obj->otyp);
|
||||||
|
|||||||
Reference in New Issue
Block a user