fix github issue #1360 - autounlock=Kick
Issue reported by ostrosablin: having Kick enabled as one of the values for the 'autounlock' option succeeded it prompting "kick it?" when walking into a locked closed door, but answering "yes" behaved the same as answering "no". There's bound to be a better way of fixing this, but this works. Fixes #1360
This commit is contained in:
@@ -2085,6 +2085,8 @@ farlook of /e or /E stopped reporting engraving and headstone text after a fix
|
|||||||
message was garbled when lightning or acid breath hit iron bars
|
message was garbled when lightning or acid breath hit iron bars
|
||||||
shop bug: buying a container with unpaid items in it could produce impossible
|
shop bug: buying a container with unpaid items in it could produce impossible
|
||||||
"unpaid_cost: object not on any bill" warnings
|
"unpaid_cost: object not on any bill" warnings
|
||||||
|
when walking into/against a locked closed door, 'autounlock'==kick didn't
|
||||||
|
execute kick when player answered yes to "Door is locked. Kick it?"
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository
|
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository
|
||||||
|
|||||||
18
src/hack.c
18
src/hack.c
@@ -1073,8 +1073,18 @@ 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) {
|
||||||
(void) doopen_indir(x, y);
|
int tmp = doopen_indir(x, y);
|
||||||
svc.context.door_opened = !closed_door(x, y);
|
/* if 'autounlock' includes Kick, we might have a
|
||||||
|
kick at the door queued up after doopen_indir() */
|
||||||
|
struct _cmd_queue *cq = cmdq_peek(CQ_CANNED);
|
||||||
|
|
||||||
|
if (tmp == ECMD_OK && cq && cq->typ == CMDQ_EXTCMD
|
||||||
|
&& cq->ec_entry == ext_func_tab_from_func(dokick))
|
||||||
|
/* door hasn't been opened, but fake it so that
|
||||||
|
canned kick will be executed as next command */
|
||||||
|
svc.context.door_opened = TRUE;
|
||||||
|
else
|
||||||
|
svc.context.door_opened = !closed_door(x, y);
|
||||||
svc.context.move = (ux != u.ux || uy != u.uy);
|
svc.context.move = (ux != u.ux || uy != 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
|
||||||
@@ -2057,7 +2067,9 @@ domove_fight_web(coordxy x, coordxy y)
|
|||||||
|
|
||||||
/* maybe swap places with a pet? returns TRUE if swapped places */
|
/* maybe swap places with a pet? returns TRUE if swapped places */
|
||||||
staticfn boolean
|
staticfn boolean
|
||||||
domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y)
|
domove_swap_with_pet(
|
||||||
|
struct monst *mtmp,
|
||||||
|
coordxy x, coordxy y)
|
||||||
{
|
{
|
||||||
struct trap *trap;
|
struct trap *trap;
|
||||||
/* if it turns out we can't actually move */
|
/* if it turns out we can't actually move */
|
||||||
|
|||||||
@@ -880,13 +880,15 @@ doopen_indir(coordxy x, coordxy y)
|
|||||||
&& (unlocktool = autokey(TRUE)) != 0) {
|
&& (unlocktool = autokey(TRUE)) != 0) {
|
||||||
res = pick_lock(unlocktool, cc.x, cc.y,
|
res = pick_lock(unlocktool, cc.x, cc.y,
|
||||||
(struct obj *) 0) ? ECMD_TIME : ECMD_OK;
|
(struct obj *) 0) ? ECMD_TIME : ECMD_OK;
|
||||||
} else if (!u.usteed
|
} else if ((flags.autounlock & AUTOUNLOCK_KICK) != 0
|
||||||
&& (flags.autounlock & AUTOUNLOCK_KICK) != 0
|
&& !u.usteed /* kicking is different when mounted */
|
||||||
&& ynq("Kick it?") == 'y') {
|
&& ynq("Kick it?") == 'y') {
|
||||||
cmdq_add_ec(CQ_CANNED, dokick);
|
cmdq_add_ec(CQ_CANNED, dokick);
|
||||||
cmdq_add_dir(CQ_CANNED,
|
cmdq_add_dir(CQ_CANNED,
|
||||||
sgn(cc.x - u.ux), sgn(cc.y - u.uy), 0);
|
sgn(cc.x - u.ux), sgn(cc.y - u.uy), 0);
|
||||||
res = ECMD_TIME;
|
/* this was 'ECMD_TIME', but time shouldn't elapse until
|
||||||
|
the canned kick takes place */
|
||||||
|
res = ECMD_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user