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