From dad67436e6790348bfdcf2da62bf967a290917e4 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 29 Mar 2023 13:48:42 -0700 Subject: [PATCH] fix #K3895 - 'o' at own spot during pass-walls If standing at the location of a closed door while having Passes_walls ability, attemping to open that door with 'o' reported "you don't find anything here to loot". Using 'o' to loot for direction ./>/< is intentional but it ignored the possibility of there also being a closed door present. When the latter applies, only switch from open to loot for direction '>' so that '.' (and '<') will open the door. Doesn't matter for creatures that can ooze under a closed door--trying to use 'o' gets rejected for them because they lack hands. Also allow hero in Passes_walls form to use 'c' when at open door spot. (For creatures that ooze under doors, 'c' is rejected just like 'o'.) Unrelated: fix a typo in a recently added comment. --- doc/fixes3-7-0.txt | 3 +++ src/lock.c | 7 ++++--- src/trap.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 025eedc9b..0690b5d7d 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1129,6 +1129,9 @@ having worn levitation boots removed and destroyed (scroll, monster spell, ensure that all window interfaces respect flags.silent (suppress terminal beep) falling into lava, being life-saved, and teleporting out could yield redundant descriptions of what was present at hero's new location +if hero had passes-walls capability and was at the location of a closed door, + attempting to use 'o' on own spot reported "you don't find anything + here to loot"; change to open door for '.' (or '<'), only loot for '>' Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/lock.c b/src/lock.c index 77ca57e8c..45a195fc7 100644 --- a/src/lock.c +++ b/src/lock.c @@ -794,8 +794,9 @@ doopen_indir(coordxy x, coordxy y) return ECMD_OK; } - /* open at yourself/up/down */ - if (u_at(cc.x, cc.y)) + /* open at yourself/up/down: switch to loot unless there is a closed + door here (possible with Passes_walls) and direction isn't 'down' */ + if (u_at(cc.x, cc.y) && (u.dz > 0 || !closed_door(u.ux, u.uy))) return doloot(); /* this used to be done prior to get_adjacent_loc() but doing so was @@ -958,7 +959,7 @@ doclose(void) x = u.ux + u.dx; y = u.uy + u.dy; - if (u_at(x, y)) { + if (u_at(x, y) && !Passes_walls) { You("are in the way!"); return ECMD_TIME; } diff --git a/src/trap.c b/src/trap.c index aaac11b49..e7fc2e92a 100644 --- a/src/trap.c +++ b/src/trap.c @@ -6162,7 +6162,7 @@ lava_effects(void) iflags.in_lava_effects--; /* - * 3.7: this used to be uncondtional "back on solid " + * 3.7: this used to be unconditional "back on solid " * but surface() could return a lot of things where that ends up * sounding silly. Deal with water, ignore furniture; assume * surface types 'air' and 'cloud' won't be present on same level