Avoid using doopen return value in test_move
We can't rely on doopen_indir return value to check whether hero moved and opened a door. Instead, explicitly check whether the door is still closed, and whether hero moved.
This commit is contained in:
+3
-3
@@ -1073,9 +1073,9 @@ test_move(
|
|||||||
" but can't squeeze your possessions through.");
|
" but can't squeeze your possessions through.");
|
||||||
if (flags.autoopen && !svc.context.run
|
if (flags.autoopen && !svc.context.run
|
||||||
&& !Confusion && !Stunned && !Fumbling) {
|
&& !Confusion && !Stunned && !Fumbling) {
|
||||||
svc.context.door_opened
|
(void) doopen_indir(x, y);
|
||||||
= svc.context.move
|
svc.context.door_opened = !closed_door(x, y);
|
||||||
= (doopen_indir(x, y) == ECMD_TIME ? 1 : 0);
|
svc.context.move = (x != u.ux || y != u.uy);
|
||||||
} else if (x == ux || y == uy) {
|
} else if (x == ux || y == uy) {
|
||||||
if (Blind || Stunned || ACURR(A_DEX) < 10
|
if (Blind || Stunned || ACURR(A_DEX) < 10
|
||||||
|| Fumbling) {
|
|| Fumbling) {
|
||||||
|
|||||||
Reference in New Issue
Block a user