Ask to kick a locked door open, if hero has no unlocking tool

This commit is contained in:
Pasi Kallinen
2022-04-03 13:58:50 +03:00
parent 4721ae7154
commit 92c21b588b
6 changed files with 54 additions and 3 deletions

View File

@@ -798,8 +798,15 @@ doopen_indir(int x, int y)
break;
}
pline("This door%s.", mesg);
if (locked && flags.autounlock && (unlocktool = autokey(TRUE)) != 0) {
res = pick_lock(unlocktool, cc.x, cc.y, (struct obj *) 0) ? ECMD_TIME : ECMD_OK;
if (locked) {
if (flags.autounlock && (unlocktool = autokey(TRUE)) != 0) {
res = pick_lock(unlocktool, cc.x, cc.y,
(struct obj *) 0) ? ECMD_TIME : ECMD_OK;
} else if (!u.usteed && ynq("Kick it?") == 'y') {
cmdq_add_ec(dokick);
cmdq_add_dir(sgn(cc.x - u.ux), sgn(cc.y - u.uy), 0);
res = ECMD_TIME;
}
}
return res;
}