fix U88 - invisible hero didn't sense self via ESP
If the character was invisible without being able to see invisible, his location on the map showed any object there or underlying topology instead of the hero even when monsters could be seen with infravision, ESP, or sustained monster detection. The ESP case required an amulet or helm or quest artifact to be noticeable because being blind overrides being unable to see invisible, so the more common form of telepathy didn't exhibit this behavior.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)display.c 3.4 2000/07/27 */
|
||||
/* SCCS Id: @(#)display.c 3.4 2002/10/03 */
|
||||
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
|
||||
/* and Dave Cohrs, 1990. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -667,7 +667,7 @@ newsym(x,y)
|
||||
return;
|
||||
}
|
||||
if (x == u.ux && y == u.uy) {
|
||||
if (canseeself()) {
|
||||
if (senseself()) {
|
||||
_map_location(x,y,0); /* map *under* self */
|
||||
display_self();
|
||||
} else
|
||||
@@ -709,7 +709,7 @@ newsym(x,y)
|
||||
if (x == u.ux && y == u.uy) {
|
||||
feel_location(u.ux, u.uy); /* forces an update */
|
||||
|
||||
if (canseeself()) display_self();
|
||||
if (senseself()) display_self();
|
||||
}
|
||||
else if ((mon = m_at(x,y))
|
||||
&& ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)
|
||||
@@ -1060,11 +1060,17 @@ void
|
||||
see_monsters()
|
||||
{
|
||||
register struct monst *mon;
|
||||
|
||||
for (mon = fmon; mon; mon = mon->nmon) {
|
||||
if (DEADMONSTER(mon)) continue;
|
||||
newsym(mon->mx,mon->my);
|
||||
if (mon->wormno) see_wsegs(mon);
|
||||
}
|
||||
#ifdef STEED
|
||||
/* when mounted, hero's location gets caught by monster loop */
|
||||
if (!u.usteed)
|
||||
#endif
|
||||
newsym(u.ux, u.uy);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1076,16 +1082,19 @@ void
|
||||
set_mimic_blocking()
|
||||
{
|
||||
register struct monst *mon;
|
||||
for (mon = fmon; mon; mon = mon->nmon)
|
||||
if(!DEADMONSTER(mon) && mon->minvis &&
|
||||
|
||||
for (mon = fmon; mon; mon = mon->nmon) {
|
||||
if (DEADMONSTER(mon)) continue;
|
||||
if (mon->minvis &&
|
||||
((mon->m_ap_type == M_AP_FURNITURE &&
|
||||
(mon->mappearance == S_vcdoor || mon->mappearance == S_hcdoor))||
|
||||
(mon->mappearance == S_vcdoor || mon->mappearance == S_hcdoor)) ||
|
||||
(mon->m_ap_type == M_AP_OBJECT && mon->mappearance == BOULDER))) {
|
||||
if(See_invisible)
|
||||
block_point(mon->mx, mon->my);
|
||||
else
|
||||
unblock_point(mon->mx, mon->my);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
25
src/pager.c
25
src/pager.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)pager.c 3.4 2002/07/25 */
|
||||
/* SCCS Id: @(#)pager.c 3.4 2002/10/03 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -65,7 +65,7 @@ lookat(x, y, buf, monbuf)
|
||||
|
||||
buf[0] = monbuf[0] = 0;
|
||||
glyph = glyph_at(x,y);
|
||||
if (u.ux == x && u.uy == y && canseeself()) {
|
||||
if (u.ux == x && u.uy == y && senseself()) {
|
||||
char race[QBUFSZ];
|
||||
|
||||
/* if not polymorphed, show both the role and the race */
|
||||
@@ -89,6 +89,27 @@ lookat(x, y, buf, monbuf)
|
||||
Strcat(buf, steedbuf);
|
||||
}
|
||||
#endif
|
||||
/* When you see yourself normally, no explanation is appended
|
||||
(even if you could also see yourself via other means).
|
||||
Sensing self while blind or swallowed is treated as if it
|
||||
were by normal vision (cf canseeself()). */
|
||||
if ((Invisible || u.uundetected) && !Blind && !u.uswallow) {
|
||||
unsigned how = 0;
|
||||
|
||||
if (Infravision) how |= 1;
|
||||
if (Unblind_telepat) how |= 2;
|
||||
if (Detect_monsters) how |= 4;
|
||||
|
||||
if (how)
|
||||
Sprintf(eos(buf), " [seen: %s%s%s%s%s]",
|
||||
(how & 1) ? "infravision" : "",
|
||||
/* add comma if telep and infrav */
|
||||
((how & 3) > 2) ? ", " : "",
|
||||
(how & 2) ? "telepathy" : "",
|
||||
/* add comma if detect and (infrav or telep or both) */
|
||||
((how & 7) > 4) ? ", " : "",
|
||||
(how & 4) ? "monster detection" : "");
|
||||
}
|
||||
} else if (u.uswallow) {
|
||||
/* all locations when swallowed other than the hero are the monster */
|
||||
Sprintf(buf, "interior of %s",
|
||||
|
||||
Reference in New Issue
Block a user