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:
@@ -880,13 +880,15 @@ doopen_indir(coordxy x, coordxy y)
|
||||
&& (unlocktool = autokey(TRUE)) != 0) {
|
||||
res = pick_lock(unlocktool, cc.x, cc.y,
|
||||
(struct obj *) 0) ? ECMD_TIME : ECMD_OK;
|
||||
} else if (!u.usteed
|
||||
&& (flags.autounlock & AUTOUNLOCK_KICK) != 0
|
||||
} else if ((flags.autounlock & AUTOUNLOCK_KICK) != 0
|
||||
&& !u.usteed /* kicking is different when mounted */
|
||||
&& ynq("Kick it?") == 'y') {
|
||||
cmdq_add_ec(CQ_CANNED, dokick);
|
||||
cmdq_add_dir(CQ_CANNED,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user