Skip to content

Commit

Permalink
wand of locking message (trunk only)
Browse files Browse the repository at this point in the history
<email deleted> wrote:
> BUGS TO REPORT:
>
> * Zapping a wand of locking at an open door with an object on it probably
> shouldn't give a "Something's in the way." message - especially if the wand is
> unidentified.

avoid "Something's in the way" message with unidentified wand of locking
  • Loading branch information
nethack.allison committed Mar 8, 2006
1 parent 71ed473 commit 354f425
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ custom arrival message for special levels could be delivered too soon
prevent scroll of charging that has already disappeared from showing in the
picklist of things to charge
doors break instead of absorbing the blast of a broken wand of striking
avoid "Something's in the way" message with unidentified wand of locking


Platform- and/or Interface-Specific Fixes
Expand Down
18 changes: 10 additions & 8 deletions src/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ STATIC_VAR NEARDATA struct xlock_s {
} xlock;

STATIC_DCL const char *NDECL(lock_action);
STATIC_DCL boolean FDECL(obstructed,(int,int));
STATIC_DCL boolean FDECL(obstructed,(int,int,BOOLEAN_P));
STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *));

boolean
Expand Down Expand Up @@ -578,21 +578,22 @@ doopen() /* try to open a door */

STATIC_OVL
boolean
obstructed(x,y)
obstructed(x,y,quietly)
register int x, y;
boolean quietly;
{
register struct monst *mtmp = m_at(x, y);

if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) {
if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere;
pline("%s stands in the way!", !canspotmon(mtmp) ?
if (!quietly) pline("%s stands in the way!", !canspotmon(mtmp) ?
"Some creature" : Monnam(mtmp));
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
return(TRUE);
}
if (OBJ_AT(x, y)) {
objhere: pline("%s's in the way.", Something);
objhere: if (!quietly) pline("%s's in the way.", Something);
return(TRUE);
}
return(FALSE);
Expand Down Expand Up @@ -650,7 +651,7 @@ doclose() /* try to close a door */
return(0);
}

if(obstructed(x, y)) return(0);
if(obstructed(x, y, FALSE)) return(0);

if(door->doormask == D_BROKEN) {
pline("This door is broken.");
Expand Down Expand Up @@ -748,7 +749,8 @@ int x, y;
const char *msg = (const char *)0;
const char *dustcloud = "A cloud of dust";
const char *quickly_dissipates = "quickly dissipates";

boolean mysterywand = (otmp->oclass == WAND_CLASS && !otmp->dknown);

if (door->typ == SDOOR) {
switch (otmp->otyp) {
case WAN_OPENING:
Expand Down Expand Up @@ -780,7 +782,7 @@ int x, y;
dustcloud);
else
You_hear("a swoosh.");
if (obstructed(x,y)) {
if (obstructed(x,y,mysterywand)) {
if (vis) pline_The("cloud %s.",quickly_dissipates);
return FALSE;
}
Expand All @@ -791,7 +793,7 @@ int x, y;
return TRUE;
}
#endif
if (obstructed(x,y)) return FALSE;
if (obstructed(x,y,mysterywand)) return FALSE;
/* Don't allow doors to close over traps. This is for pits */
/* & trap doors, but is it ever OK for anything else? */
if (t_at(x,y)) {
Expand Down

0 comments on commit 354f425

Please sign in to comment.