Wield and swapweapon ext cmd fail return values
This commit is contained in:
18
src/wield.c
18
src/wield.c
@@ -322,8 +322,7 @@ dowield(void)
|
||||
g.multi = 0;
|
||||
if (cantwield(g.youmonst.data)) {
|
||||
pline("Don't be ridiculous!");
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
}
|
||||
|
||||
/* Prompt for a new weapon */
|
||||
@@ -336,8 +335,7 @@ dowield(void)
|
||||
You("are already wielding that!");
|
||||
if (is_weptool(wep) || is_wet_towel(wep))
|
||||
g.unweapon = FALSE; /* [see setuwep()] */
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
} else if (welded(uwep)) {
|
||||
weldmsg(uwep);
|
||||
/* previously interrupted armor removal mustn't be resumed */
|
||||
@@ -345,8 +343,7 @@ dowield(void)
|
||||
/* if player chose a partial stack but can't wield it, undo split */
|
||||
if (wep->o_id && wep->o_id == g.context.objsplit.child_oid)
|
||||
unsplitobj(wep);
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
} else if (wep->o_id && wep->o_id == g.context.objsplit.child_oid) {
|
||||
/* if wep is the result of supplying a count to getobj()
|
||||
we don't want to split something already wielded; for
|
||||
@@ -401,8 +398,7 @@ dowield(void)
|
||||
setuqwep((struct obj *) 0);
|
||||
} else if (wep->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE)) {
|
||||
You("cannot wield that!");
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
}
|
||||
|
||||
wielding:
|
||||
@@ -435,13 +431,11 @@ doswapweapon(void)
|
||||
g.multi = 0;
|
||||
if (cantwield(g.youmonst.data)) {
|
||||
pline("Don't be ridiculous!");
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
}
|
||||
if (welded(uwep)) {
|
||||
weldmsg(uwep);
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_FAIL;
|
||||
}
|
||||
|
||||
/* Unwield your current secondary weapon */
|
||||
|
||||
Reference in New Issue
Block a user