Fix fire auto-swapweaponing to polearm

When you have a polearm as secondary weapon, have a fireassist on,
and press 'f' to fire, the code tries to swapweapon to the polearm.
This failed badly and got stuck in a loop if you were also wearing
a shield - as polearms are two-handed and shield prevents wielding
those.

Add a new "command failed" result, and clear the command queue
in that case. Also make swapweapon and wield actually return
the ECMD flags back to the rhack loop.
This commit is contained in:
Pasi Kallinen
2022-02-17 09:12:03 +02:00
parent b25138e6d9
commit 953a534cc5
3 changed files with 6 additions and 4 deletions

View File

@@ -3976,9 +3976,9 @@ rhack(char *cmd)
prefix_seen = 0;
was_m_prefix = FALSE;
}
if ((res & ECMD_CANCEL)) {
if ((res & (ECMD_CANCEL|ECMD_FAIL))) {
/* command was canceled by user, maybe they declined to
pick an object to act on. */
pick an object to act on, or command failed to finish */
reset_cmd_vars(TRUE);
prefix_seen = 0;
cmdq_ec = NULL;