Make extended commands return defined flags

Instead of returning 0 or 1, we'll now use ECMD_OK or ECMD_TURN.
These have the same meaning as the hardcoded numbers; ECMD_TURN
means the command uses a turn.

In future, could add eg. a flag denoting "user cancelled command"
or "command failed", and should clear eg. the cmdq.

Mostly this was simply replacing return values with the defines
in the extended commands, so hopefully I didn't break anything.
This commit is contained in:
Pasi Kallinen
2021-12-30 18:46:30 +02:00
parent 511ce70309
commit d53cd28d46
46 changed files with 821 additions and 793 deletions

View File

@@ -1829,7 +1829,7 @@ doattributes(void)
mode |= MAGICENLIGHTENMENT;
enlightenment(mode, ENL_GAMEINPROGRESS);
return 0;
return ECMD_OK;
}
void
@@ -1895,7 +1895,7 @@ int
doconduct(void)
{
show_conduct(0);
return 0;
return ECMD_OK;
}
/* display conducts; for doconduct(), also disclose() and dump_everything() */
@@ -2415,7 +2415,7 @@ int
dovanquished(void)
{
list_vanquished('a', FALSE);
return 0;
return ECMD_OK;
}
DISABLE_WARNING_FORMAT_NONLITERAL
@@ -2450,7 +2450,7 @@ doborn(void)
display_nhwindow(datawin, FALSE);
destroy_nhwindow(datawin);
return 0;
return ECMD_OK;
}
RESTORE_WARNING_FORMAT_NONLITERAL