wand of locking message (trunk only)

<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
This commit is contained in:
nethack.allison
2006-03-08 23:08:25 +00:00
parent 71ed473cf6
commit 354f4254bc
2 changed files with 11 additions and 8 deletions
+1
View File
@@ -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 prevent scroll of charging that has already disappeared from showing in the
picklist of things to charge picklist of things to charge
doors break instead of absorbing the blast of a broken wand of striking 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 Platform- and/or Interface-Specific Fixes
+9 -7
View File
@@ -16,7 +16,7 @@ STATIC_VAR NEARDATA struct xlock_s {
} xlock; } xlock;
STATIC_DCL const char *NDECL(lock_action); 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 *)); STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *));
boolean boolean
@@ -578,21 +578,22 @@ doopen() /* try to open a door */
STATIC_OVL STATIC_OVL
boolean boolean
obstructed(x,y) obstructed(x,y,quietly)
register int x, y; register int x, y;
boolean quietly;
{ {
register struct monst *mtmp = m_at(x, y); register struct monst *mtmp = m_at(x, y);
if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) {
if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; 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)); "Some creature" : Monnam(mtmp));
if (!canspotmon(mtmp)) if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my); map_invisible(mtmp->mx, mtmp->my);
return(TRUE); return(TRUE);
} }
if (OBJ_AT(x, y)) { 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(TRUE);
} }
return(FALSE); return(FALSE);
@@ -650,7 +651,7 @@ doclose() /* try to close a door */
return(0); return(0);
} }
if(obstructed(x, y)) return(0); if(obstructed(x, y, FALSE)) return(0);
if(door->doormask == D_BROKEN) { if(door->doormask == D_BROKEN) {
pline("This door is broken."); pline("This door is broken.");
@@ -748,6 +749,7 @@ int x, y;
const char *msg = (const char *)0; const char *msg = (const char *)0;
const char *dustcloud = "A cloud of dust"; const char *dustcloud = "A cloud of dust";
const char *quickly_dissipates = "quickly dissipates"; const char *quickly_dissipates = "quickly dissipates";
boolean mysterywand = (otmp->oclass == WAND_CLASS && !otmp->dknown);
if (door->typ == SDOOR) { if (door->typ == SDOOR) {
switch (otmp->otyp) { switch (otmp->otyp) {
@@ -780,7 +782,7 @@ int x, y;
dustcloud); dustcloud);
else else
You_hear("a swoosh."); You_hear("a swoosh.");
if (obstructed(x,y)) { if (obstructed(x,y,mysterywand)) {
if (vis) pline_The("cloud %s.",quickly_dissipates); if (vis) pline_The("cloud %s.",quickly_dissipates);
return FALSE; return FALSE;
} }
@@ -791,7 +793,7 @@ int x, y;
return TRUE; return TRUE;
} }
#endif #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 */ /* Don't allow doors to close over traps. This is for pits */
/* & trap doors, but is it ever OK for anything else? */ /* & trap doors, but is it ever OK for anything else? */
if (t_at(x,y)) { if (t_at(x,y)) {