open/close/loot while confused or stunned (trunk only)

Fix a bug From a bug report:  while stunned he tried to close
an adjacent open door and when his choice of direction got changed to
some non-door spot, no time elapsed so he could just keep repeating the
attempt until eventually getting the correct direction.  Trying to open
an adjacent closed door and trying to remove the saddle from an adjacent
monster via #loot behaved similarly.  Applying keys and lock-picks also
did so in 3.4.3, but had already been changed to use up time in the dev
code.  There may be other actions which need fixing.
This commit is contained in:
nethack.rankin
2010-02-02 23:10:01 +00:00
parent 84dccb47cf
commit 97c2f8ef03
3 changed files with 20 additions and 6 deletions

View File

@@ -561,6 +561,10 @@ doopen() /* try to open a door */
return(1);
}
/* when choosing a direction is impaired, use a turn
regardless of whether a door is successfully targetted */
if (Confusion || Stunned) res = 1;
door = &levl[cc.x][cc.y];
portcullis = (is_drawbridge_wall(cc.x, cc.y) >= 0);
if (Blind) {
@@ -689,6 +693,10 @@ doclose() /* try to close a door */
return(1);
}
/* when choosing a direction is impaired, use a turn
regardless of whether a door is successfully targetted */
if (Confusion || Stunned) res = 1;
door = &levl[x][y];
portcullis = (is_drawbridge_wall(x, y) >= 0);
if (Blind) {