Add "user canceled" as extended command return value
Instead of returning ECMD_OK, the commands now return ECMD_CANCEL when user declined to pick a direction or an object to act on. Note that this can be ORed with ECMD_TIME, if the command still took a turn. For now this has no gameplay meaning.
This commit is contained in:
@@ -329,8 +329,7 @@ dowield(void)
|
||||
clear_splitobjs();
|
||||
if (!(wep = getobj("wield", wield_ok, GETOBJ_PROMPT | GETOBJ_ALLOWCNT))) {
|
||||
/* Cancelled */
|
||||
cmdq_clear();
|
||||
return ECMD_OK;
|
||||
return ECMD_CANCEL;
|
||||
} else if (wep == uwep) {
|
||||
already_wielded:
|
||||
You("are already wielding that!");
|
||||
@@ -491,7 +490,7 @@ dowieldquiver(void)
|
||||
|
||||
if (!newquiver) {
|
||||
/* Cancelled */
|
||||
return ECMD_OK;
|
||||
return ECMD_CANCEL;
|
||||
} else if (newquiver == &cg.zeroobj) { /* no object */
|
||||
/* Explicitly nothing */
|
||||
if (uquiver) {
|
||||
|
||||
Reference in New Issue
Block a user