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

@@ -537,6 +537,10 @@ enum bodypart_types {
#define BRK_KNOWN2NOTBREAK 8
#define BRK_KNOWN_OUTCOME (BRK_KNOWN2BREAK | BRK_KNOWN2NOTBREAK)
/* extended command return values */
#define ECMD_OK 0x00 /* cmd done successfully */
#define ECMD_TIME 0x01 /* cmd took time, uses up a turn */
/* values returned from getobj() callback functions */
enum getobj_callback_returns {
/* generally invalid - can't be used for this purpose. will give a "silly