]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only change limits when adding the mutator (might fix incorrect timelimits)
authorMario <mario@smbclan.net>
Fri, 30 Oct 2015 03:59:15 +0000 (13:59 +1000)
committerMario <mario@smbclan.net>
Fri, 30 Oct 2015 04:03:03 +0000 (14:03 +1000)
12 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_onslaught.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc

index 72873b3eb0a24b11513a53476e0cff8564e25fd4..9a8df7854666d17508dfae51a38d7450bdc07bad 100644 (file)
@@ -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
index b9621cdadaf1822535d7a3f6d3a4c7e8f091b5fb..725569bfff6469745c55a56ffcce910131287071 100644 (file)
@@ -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
index 924cc55f6f833cc563060425789b7eac18cbf8e4..13dec008e059f63bc34106a9addd212242c415cb 100644 (file)
@@ -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
index 982da6ea3e6307699aead50e51b4fafe666ec05a..a220801eefb6ed3ee46a5ccdbfbfe5b491572700 100644 (file)
@@ -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
index 5195177dfcb1b493093e7ad385b590158c2f02ad..8c5d5159d5383e5763bd7cb818ff8359c6e31c9e 100644 (file)
@@ -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
index c392c4be58dc40675a157cd6868ef12a053a7f95..14e345046b2db29a9011d60db40c594bdbea0fb8 100644 (file)
@@ -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
index f52afb9e2fcbcf73ee87e75ae945d17bae23577f..1fa986483bd4ed9d31678bb6a3867f2a2fa4b916 100644 (file)
@@ -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
index 5982cf2085436442543488477e823925958eeb52..acc7d88733e6d282fba0a09e27b6c0165436ca13 100644 (file)
@@ -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
index f2ee672dad4026b425160afb8e3771f7fd93c100..9fa7f4739715b39269c9b4e600ee8ce6705a0d69 100644 (file)
@@ -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
index 51ddcadf91cafad9e790a6cb98bcd151625ac5f8..5d23ec73b881bda4f2a5ce10a9d97b084fc019ff 100644 (file)
@@ -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
index 229242f8b3cca30c17feb55aaafdf0f08ac249c5..4fbafe03535a21da375d031d38aa3c8f37817021 100644 (file)
@@ -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
index 49ec0acc9f5e3dd90be9013a671ba107f93cc827..42415a495e7140dbab08c4e9a47c925f51be4022 100644 (file)
@@ -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