if (!VoteCommand_checkargs(startpos, argc)) return 0;
+ switch (MUTATOR_CALLHOOK(VoteCommand_Parse, caller, first_command, vote_command, startpos, argc))
+ {
+ case MUT_VOTEPARSE_CONTINUE: { break; }
+ case MUT_VOTEPARSE_SUCCESS: { return 1; }
+ case MUT_VOTEPARSE_INVALID: { return -1; }
+ case MUT_VOTEPARSE_UNACCEPTABLE: { return 0; }
+ }
+
switch (first_command) // now go through and parse the proper commands to adjust as needed.
{
case "kick":
/** player */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(CalculateRespawnTime, EV_CalculateRespawnTime);
+
+/** called when parsing a vote command. */
+#define EV_VoteCommand_Parse(i, o) \
+ /** caller */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** first command */ i(string, MUTATOR_ARGV_1_string) \
+ /** vote command */ i(string, MUTATOR_ARGV_2_string) \
+ /** start position of vote command */ i(float, MUTATOR_ARGV_3_float) \
+ /** argument count */ i(float, MUTATOR_ARGV_4_float) \
+ /**/
+MUTATOR_HOOKABLE(VoteCommand_Parse, EV_VoteCommand_Parse);
+
+enum {
+ MUT_VOTEPARSE_CONTINUE, // return this flag to make the function continue as normal
+ MUT_VOTEPARSE_SUCCESS, // return 1 (vote parsed)
+ MUT_VOTEPARSE_INVALID, // return -1 (vote parsed but counted as invalid, no action or vote)
+ MUT_VOTEPARSE_UNACCEPTABLE // return 0 (vote parameter counted as unacceptable, warns caller)
+};