Fix autowielding tools taking no time

When applying some tools (whips, polearms, grapples), or rubbing
a lamp, or when fireassist is on and you fire something without
wielded launcher, the automatic wielding should take as much time
as wielding the item normally does.

Fixes #696
This commit is contained in:
Pasi Kallinen
2022-03-15 11:34:45 +02:00
parent cc04bf9d8f
commit 006ae67029
3 changed files with 36 additions and 21 deletions

View File

@@ -966,10 +966,13 @@ use_pick_axe(struct obj *obj)
/* Check tool */
if (obj != uwep) {
if (!wield_tool(obj, "swing"))
return ECMD_OK;
else
res = ECMD_TIME;
if (wield_tool(obj, "swing")) {
/* we're now wielding it. next turn, apply to dig. */
cmdq_add_ec(doapply);
cmdq_add_key(obj->invlet);
return ECMD_TIME;
}
return ECMD_OK;
}
ispick = is_pick(obj);
verb = ispick ? "dig" : "chop";