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

@@ -7270,7 +7270,7 @@ longest_option_name(int startpass, int endpass)
return longest_name_len;
}
/* the 'O' command */
/* the #options command */
int
doset(void) /* changing options via menu by Per Liboriussen */
{
@@ -7460,7 +7460,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
if (g.context.botl || g.context.botlx) {
bot();
}
return 0;
return ECMD_OK;
}
/* doset('O' command) menu entries for compound options */
@@ -7719,7 +7719,7 @@ dotogglepickup(void)
Strcpy(buf, "OFF");
}
pline("Autopickup: %s.", buf);
return 0;
return ECMD_OK;
}
int