fix github issue #277 - repeat door open failure
The change to make "ouch! you bump into a door" use up a turn didn't end running, so when it happened while running useless turns took place and that message was delivered repeatedly until some other action interrupted the hero. It didn't matter whether autoopen is enabled. Fixes #277
This commit is contained in:
13
src/hack.c
13
src/hack.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 hack.c $NHDT-Date: 1578448654 2020/01/08 01:57:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.239 $ */
|
||||
/* NetHack 3.6 hack.c $NHDT-Date: 1578690701 2020/01/10 21:11:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.240 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -749,8 +749,8 @@ int mode;
|
||||
/* Eat the rock. */
|
||||
if (mode == DO_MOVE && still_chewing(x, y))
|
||||
return FALSE;
|
||||
} else if (flags.autodig && !g.context.run && !g.context.nopick && uwep
|
||||
&& is_pick(uwep)) {
|
||||
} else if (flags.autodig && !g.context.run && !g.context.nopick
|
||||
&& uwep && is_pick(uwep)) {
|
||||
/* MRKR: Automatic digging when wielding the appropriate tool */
|
||||
if (mode == DO_MOVE)
|
||||
(void) use_pick_axe2(uwep);
|
||||
@@ -815,6 +815,9 @@ int mode;
|
||||
set, 'move' would get reset by caller */
|
||||
g.context.door_opened
|
||||
= g.context.move = TRUE;
|
||||
/* since we've just lied about successfully
|
||||
moving, we need to manually stop running */
|
||||
nomul(0);
|
||||
} else
|
||||
pline("That door is closed.");
|
||||
}
|
||||
@@ -2808,8 +2811,8 @@ lookaround()
|
||||
pline_The("corridor widens here.");
|
||||
goto stop;
|
||||
}
|
||||
if ((g.context.run == 1 || g.context.run == 3 || g.context.run == 8) && !noturn
|
||||
&& !m0 && i0 && (corrct == 1 || (corrct == 2 && i0 == 1))) {
|
||||
if ((g.context.run == 1 || g.context.run == 3 || g.context.run == 8)
|
||||
&& !noturn && !m0 && i0 && (corrct == 1 || (corrct == 2 && i0 == 1))) {
|
||||
/* make sure that we do not turn too far */
|
||||
if (i0 == 2) {
|
||||
if (u.dx == y0 - u.uy && u.dy == u.ux - x0)
|
||||
|
||||
Reference in New Issue
Block a user