diff --git a/include/extern.h b/include/extern.h index 7e5195cc8..8f6bb1c84 100644 --- a/include/extern.h +++ b/include/extern.h @@ -306,6 +306,7 @@ E void FDECL(map_object, (struct obj *, int)); E void FDECL(map_invisible, (XCHAR_P, XCHAR_P)); E void FDECL(unmap_object, (int, int)); E void FDECL(map_location, (int, int, int)); +E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P)); E void FDECL(feel_location, (XCHAR_P, XCHAR_P)); E void FDECL(newsym, (int, int)); E void FDECL(shieldeff, (XCHAR_P, XCHAR_P)); diff --git a/src/apply.c b/src/apply.c index 9379fb24c..952e5fa7b 100644 --- a/src/apply.c +++ b/src/apply.c @@ -401,19 +401,13 @@ register struct obj *obj; case SDOOR: You_hear(hollow_str, "door"); cvt_sdoor_to_door(lev); /* ->typ = DOOR */ - if (Blind) - feel_location(rx, ry); - else - newsym(rx, ry); + feel_newsym(rx, ry); return res; case SCORR: You_hear(hollow_str, "passage"); lev->typ = CORR; unblock_point(rx, ry); - if (Blind) - feel_location(rx, ry); - else - newsym(rx, ry); + feel_newsym(rx, ry); return res; } diff --git a/src/detect.c b/src/detect.c index c8f824eed..f33ce7139 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1291,10 +1291,7 @@ struct trap *trap; trap->tseen = 1; exercise(A_WIS, TRUE); - if (Blind) - feel_location(trap->tx, trap->ty); - else - newsym(trap->tx, trap->ty); + feel_newsym(trap->tx, trap->ty); if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) { /* There's too much clutter to see your find otherwise */ diff --git a/src/dig.c b/src/dig.c index 0631c4365..17fcf4553 100644 --- a/src/dig.c +++ b/src/dig.c @@ -81,10 +81,7 @@ boolean waslit, rockit; lev->typ = (rockit ? STONE : ROOM); if (dist >= 3) impossible("mkcavepos called with dist %d", dist); - if (Blind) - feel_location(x, y); - else - newsym(x, y); + feel_newsym(x, y); } STATIC_OVL void @@ -437,10 +434,7 @@ dig(VOID_ARGS) if (!does_block(dpx, dpy, &levl[dpx][dpy])) unblock_point(dpx, dpy); /* vision: can see through */ - if (Blind) - feel_location(dpx, dpy); - else - newsym(dpx, dpy); + feel_newsym(dpx, dpy); if (digtxt && !context.digging.quiet) pline1(digtxt); /* after newsym */ if (dmgtxt) diff --git a/src/display.c b/src/display.c index c6c7f7206..e75f74d53 100644 --- a/src/display.c +++ b/src/display.c @@ -486,6 +486,23 @@ register struct monst *mon; show_glyph(x, y, glyph); } + +/* + * feel_newsym() + * + * When hero knows what happened to location, even when blind. + */ +void +feel_newsym(x, y) +xchar x, y; +{ + if (Blind) + feel_location(x, y); + else + newsym(x, y); +} + + /* * feel_location() * diff --git a/src/dokick.c b/src/dokick.c index 1f4d1b42a..ca4e2a6bc 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -973,10 +973,7 @@ dokick() } else if (maploc->doormask != D_NODOOR && !(maploc->doormask & D_LOCKED)) maploc->doormask = D_ISOPEN; - if (Blind) - feel_location(x, y); /* we know it's gone */ - else - newsym(x, y); + feel_newsym(x, y); /* we know it's gone */ if (maploc->doormask == D_ISOPEN || maploc->doormask == D_NODOOR) unblock_point(x, y); /* vision */ @@ -989,10 +986,7 @@ dokick() pline("Crash! You kick open a secret passage!"); exercise(A_DEX, TRUE); maploc->typ = CORR; - if (Blind) - feel_location(x, y); /* we know it's gone */ - else - newsym(x, y); + feel_newsym(x, y); /* we know it's gone */ unblock_point(x, y); /* vision */ return 1; } else @@ -1267,10 +1261,7 @@ dokick() exercise(A_STR, TRUE); maploc->doormask = D_BROKEN; } - if (Blind) - feel_location(x, y); /* we know we broke it */ - else - newsym(x, y); + feel_newsym(x, y); /* we know we broke it */ unblock_point(x, y); /* vision */ if (shopdoor) { add_damage(x, y, 400L); diff --git a/src/lock.c b/src/lock.c index db9a57995..0f6ab0f71 100644 --- a/src/lock.c +++ b/src/lock.c @@ -648,10 +648,7 @@ int x, y; add_damage(cc.x, cc.y, 0L); } else door->doormask = D_ISOPEN; - if (Blind) - feel_location(cc.x, cc.y); /* the hero knows she opened it */ - else - newsym(cc.x, cc.y); + feel_newsym(cc.x, cc.y); /* the hero knows she opened it */ unblock_point(cc.x, cc.y); /* vision: new see through there */ } else { exercise(A_STR, TRUE); @@ -781,10 +778,7 @@ doclose() || rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) { pline_The("door closes."); door->doormask = D_CLOSED; - if (Blind) - feel_location(x, y); /* the hero knows she closed it */ - else - newsym(x, y); + feel_newsym(x, y); /* the hero knows she closed it */ block_point(x, y); /* vision: no longer see there */ } else { exercise(A_STR, TRUE); diff --git a/src/trap.c b/src/trap.c index ebc1eede1..3bef3ccae 100644 --- a/src/trap.c +++ b/src/trap.c @@ -760,10 +760,7 @@ boolean shatter; otmp = nxtobj(otmp, STATUE, TRUE); } - if (Blind) - feel_location(x, y); - else - newsym(x, y); + feel_newsym(x, y); return mtmp; }