From: Mario Date: Fri, 30 Oct 2015 03:59:15 +0000 (+1000) Subject: Only change limits when adding the mutator (might fix incorrect timelimits) X-Git-Tag: xonotic-v0.8.2~1757 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0fca74f0a20647a83f1e710308a818f19792765c;p=xonotic%2Fxonotic-data.pk3dir.git Only change limits when adding the mutator (might fix incorrect timelimits) --- diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 72873b3eb..9a8df7854 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -1069,10 +1069,6 @@ MUTATOR_HOOKFUNCTION(nb, SendWaypoint) REGISTER_MUTATOR(nb, g_nexball) { - ActivateTeamplay(); - SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, -1, -1); - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { g_nexball_meter_period = autocvar_g_nexball_meter_period; @@ -1092,6 +1088,10 @@ REGISTER_MUTATOR(nb, g_nexball) InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE); WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; + + ActivateTeamplay(); + SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, -1, -1); + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index b9621cdad..725569bff 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -9,17 +9,17 @@ void ca_Initialize(); REGISTER_MUTATOR(ca, false) { - ActivateTeamplay(); - SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, -1, -1); - - if (autocvar_g_ca_team_spawns) - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); ca_Initialize(); + + ActivateTeamplay(); + SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, -1, -1); + + if (autocvar_g_ca_team_spawns) + have_team_spawns = -1; // request team spawns } MUTATOR_ONREMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 924cc55f6..13dec008e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -6,15 +6,15 @@ void ctf_Initialize(); REGISTER_MUTATOR(ctf, false) { - ActivateTeamplay(); - SetLimits(autocvar_capturelimit_override, -1, autocvar_captureleadlimit_override, -1); - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); ctf_Initialize(); + + ActivateTeamplay(); + SetLimits(autocvar_capturelimit_override, -1, autocvar_captureleadlimit_override, -1); + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index 982da6ea3..a220801ee 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -7,15 +7,15 @@ void cts_Initialize(); REGISTER_MUTATOR(cts, false) { - g_race_qualifying = true; - independent_players = 1; - SetLimits(0, 0, 0, -1); - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); cts_Initialize(); + + g_race_qualifying = true; + independent_players = 1; + SetLimits(0, 0, 0, -1); } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 5195177df..8c5d5159d 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -10,19 +10,19 @@ void dom_Initialize(); REGISTER_MUTATOR(dom, false) { - int fraglimit_override = autocvar_g_domination_point_limit; - if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit) - fraglimit_override = autocvar_g_domination_roundbased_point_limit; - - ActivateTeamplay(); - SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, -1, -1); - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); dom_Initialize(); + + int fraglimit_override = autocvar_g_domination_point_limit; + if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit) + fraglimit_override = autocvar_g_domination_roundbased_point_limit; + + ActivateTeamplay(); + SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, -1, -1); + have_team_spawns = -1; // request team spawns } MUTATOR_ONREMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index c392c4be5..14e345046 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -8,17 +8,17 @@ void freezetag_Initialize(); REGISTER_MUTATOR(ft, false) { - ActivateTeamplay(); - SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, -1, -1); - - if (autocvar_g_freezetag_team_spawns) - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); freezetag_Initialize(); + + ActivateTeamplay(); + SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, -1, -1); + + if (autocvar_g_freezetag_team_spawns) + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index f52afb9e2..1fa986483 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -9,14 +9,6 @@ void invasion_Initialize(); REGISTER_MUTATOR(inv, false) { - SetLimits(autocvar_g_invasion_point_limit, -1, -1, -1); - if (autocvar_g_invasion_teams >= 2) - { - ActivateTeamplay(); - if (autocvar_g_invasion_team_spawns) - have_team_spawns = -1; // request team spawns - } - MUTATOR_ONADD { if (time > 1) // game loads at time 1 @@ -25,6 +17,14 @@ REGISTER_MUTATOR(inv, false) invasion_Initialize(); cvar_settemp("g_monsters", "1"); + + SetLimits(autocvar_g_invasion_point_limit, -1, -1, -1); + if (autocvar_g_invasion_teams >= 2) + { + ActivateTeamplay(); + if (autocvar_g_invasion_team_spawns) + have_team_spawns = -1; // request team spawns + } } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 5982cf208..acc7d8873 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -8,16 +8,16 @@ void kh_Initialize(); REGISTER_MUTATOR(kh, false) { - ActivateTeamplay(); - SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, -1, -1); - if (autocvar_g_keyhunt_team_spawns) - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); kh_Initialize(); + + ActivateTeamplay(); + SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, -1, -1); + if (autocvar_g_keyhunt_team_spawns) + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index f2ee672da..9fa7f4739 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -6,13 +6,13 @@ void lms_Initialize(); REGISTER_MUTATOR(lms, false) { - SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, -1, -1); - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); lms_Initialize(); + + SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, -1, -1); } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc b/qcsrc/server/mutators/mutator/gamemode_onslaught.qc index 51ddcadf9..5d23ec73b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/mutator/gamemode_onslaught.qc @@ -6,15 +6,15 @@ void ons_Initialize(); REGISTER_MUTATOR(ons, false) { - ActivateTeamplay(); - SetLimits(autocvar_g_onslaught_point_limit, -1, -1, -1); - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); ons_Initialize(); + + ActivateTeamplay(); + SetLimits(autocvar_g_onslaught_point_limit, -1, -1, -1); + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index 229242f8b..4fbafe035 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -6,13 +6,13 @@ void race_Initialize(); REGISTER_MUTATOR(rc, false) { - rc_SetLimits(); - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); race_Initialize(); + + rc_SetLimits(); } MUTATOR_ONROLLBACK_OR_REMOVE diff --git a/qcsrc/server/mutators/mutator/gamemode_tdm.qc b/qcsrc/server/mutators/mutator/gamemode_tdm.qc index 49ec0acc9..42415a495 100644 --- a/qcsrc/server/mutators/mutator/gamemode_tdm.qc +++ b/qcsrc/server/mutators/mutator/gamemode_tdm.qc @@ -8,16 +8,16 @@ void tdm_DelayedInit(); REGISTER_MUTATOR(tdm, false) { - ActivateTeamplay(); - SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, -1, -1); - if (autocvar_g_tdm_team_spawns) - have_team_spawns = -1; // request team spawns - MUTATOR_ONADD { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); InitializeEntity(world, tdm_DelayedInit, INITPRIO_GAMETYPE); + + ActivateTeamplay(); + SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, -1, -1); + if (autocvar_g_tdm_team_spawns) + have_team_spawns = -1; // request team spawns } MUTATOR_ONROLLBACK_OR_REMOVE