return;
}
- float checkrules_status;
- checkrules_status = WinningCondition_RanOutOfSpawns();
+ int checkrules_status = WinningCondition_RanOutOfSpawns();
if(checkrules_status == WINNING_YES)
- {
bprint("Hey! Someone ran out of spawns!\n");
- }
- else if(g_race && !g_race_qualifying && timelimit >= 0)
- {
- checkrules_status = WinningCondition_Race(fraglimit);
- //print("WC_RACE yields ", ftos(checkrules_status), "\n");
- }
- else if(g_race && g_race_qualifying == 2 && timelimit >= 0)
- {
- checkrules_status = WinningCondition_QualifyingThenRace(fraglimit);
- //print("WC_QUALIFYING_THEN_RACE yields ", ftos(checkrules_status), "\n");
- }
- else if(g_assault)
- {
- checkrules_status = WinningCondition_Assault(); // TODO remove this?
- }
- else if(g_lms)
- {
- checkrules_status = WinningCondition_LMS();
- }
- else
- {
+ else if(!MUTATOR_CALLHOOK(CheckRules_World, checkrules_status, timelimit, fraglimit))
checkrules_status = WinningCondition_Scores(fraglimit, leadlimit);
- //print("WC_SCORES yields ", ftos(checkrules_status), "\n");
- }
+
+ checkrules_status = ret_float;
if(checkrules_status == WINNING_STARTSUDDENDEATHOVERTIME)
{
MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
};
+
+/** called when player triggered kill (or is changing teams), return error to not do anything */
+#define EV_CheckRules_World(i, o) \
+ /* status */ i(float, ret_float) \
+ /* status */ o(float, ret_float) \
+ /* time limit */ i(float, checkrules_timelimit) \
+ /* frag limit */ i(int, checkrules_fraglimit) \
+ /**/
+float checkrules_timelimit;
+int checkrules_fraglimit;
+MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World);
#endif