TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
- if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round
+ if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round or the only round in campaign
{
status = WINNING_YES;
}
MUTATOR_HOOKFUNCTION(as, ReadyRestart_Deny)
{
// readyrestart not supported (yet)
+ // it's supported only in campaign mode (single round mode), since campaign requires it
+ if (autocvar_g_campaign)
+ return false;
return true;
}
void ReadyRestart(bool forceWarmupEnd)
{
- if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || intermission_running || race_completing) localcmd("restart\n");
+ if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || intermission_running || race_completing)
+ {
+ // NOTE: ReadyRestart support is mandatory in campaign
+ if (autocvar_g_campaign)
+ error("ReadyRestart must be supported in campaign mode!");
+ localcmd("restart\n"); // if ReadyRestart is denied, restart the server
+ }
else localcmd("\nsv_hook_readyrestart\n");
if(forceWarmupEnd || autocvar_g_campaign)
/**/
MUTATOR_HOOKABLE(ChatMessageTo, EV_ChatMessageTo);
-/** return true to just restart the match, for modes that don't support readyrestart */
+/**
+ * return true to restart the match instead of restarting the server, for modes that don't support readyrestart.
+ * NOTE: ReadyRestart support is mandatory in campaign
+ */
MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
/** called when a fusion reactor is validating its target */