]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
GameRules: make `GameRules_teams(true)` imply `have_team_spawns = -1`
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 27 Aug 2017 05:53:28 +0000 (15:53 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 27 Aug 2017 05:53:28 +0000 (15:53 +1000)
13 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
qcsrc/common/gamemodes/sv_rules.qc
qcsrc/common/gamemodes/sv_rules.qh
qcsrc/server/mutators/mutator/gamemode_assault.qh
qcsrc/server/mutators/mutator/gamemode_ca.qh
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_domination.qh
qcsrc/server/mutators/mutator/gamemode_freezetag.qh
qcsrc/server/mutators/mutator/gamemode_invasion.qh
qcsrc/server/mutators/mutator/gamemode_keyhunt.qh
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qh

index be00469cfcf0f9bda5928efc9a63b0aa177d4fe9..163cc3854185fbd7b52165fdf6ef0399e1275a44 100644 (file)
@@ -1158,7 +1158,6 @@ REGISTER_MUTATOR(nb, g_nexball)
                GameRules_teams(true);
                GameRules_limit_score(autocvar_g_nexball_goallimit);
                GameRules_limit_lead(autocvar_g_nexball_goalleadlimit);
-               have_team_spawns = -1; // request team spawns
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index f27689503be71f02a526caed8ec9c77990640d92..7f2434915e7a67b6d6ed269e36ecb4d351d88014 100644 (file)
@@ -13,7 +13,6 @@ REGISTER_MUTATOR(ons, false)
 
                GameRules_teams(true);
                GameRules_limit_score(autocvar_g_onslaught_point_limit);
-               have_team_spawns = -1; // request team spawns
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index 38e3fb2abc9893a87908d36da4f2cdead5c6526f..a4041f047a9bcf6622b45ec76de27faed441b09c 100644 (file)
@@ -8,13 +8,20 @@ void GameRules_teams(bool value)
         serverflags |= SERVERFLAG_TEAMPLAY;
         teamplay = 1;
         cvar_set("teamplay", "2");  // DP needs this for sending proper getstatus replies.
+        GameRules_spawning_teams(true);
     } else {
        serverflags &= ~SERVERFLAG_TEAMPLAY;
        teamplay = 0;
        cvar_set("teamplay", "0");  // DP needs this for sending proper getstatus replies.
+       GameRules_spawning_teams(false);
     }
 }
 
+void GameRules_spawning_teams(bool value)
+{
+    have_team_spawns = value ? -1 : 0;
+}
+
 bool _GameRules_score_enabled = true;
 void GameRules_score_enabled(bool value)
 {
index 588d8da70ba1bfa28c4d64190e150cb1077b5e91..33083b367798ee9f5afb544c054d3d9104a7cab9 100644 (file)
@@ -3,6 +3,11 @@
 // todo: accept the number of teams as a parameter
 void GameRules_teams(bool value);
 
+/**
+ * Used to disable team spawns in team modes
+ */
+void GameRules_spawning_teams(bool value);
+
 /**
  * Disabling score disables the "score" column on the scoreboard
  */
index dc46279e8cb6607d6ca0c40671142db1eef14578..abe89ecca40e6fbbdef4b065a84a0d20eb98fa4d 100644 (file)
@@ -7,7 +7,6 @@ void assault_ScoreRules();
 REGISTER_MUTATOR(as, false)
 {
        GameRules_teams(true);
-       have_team_spawns = -1; // request team spawns
 
        MUTATOR_ONADD
        {
index 5069c010d262ec338648ecb0a57f700bb711d2f2..6d4786ee529acbf5d78cb70dc459acfde7e4cd0d 100644 (file)
@@ -56,8 +56,7 @@ REGISTER_MUTATOR(ca, false)
         GameRules_limit_score(autocvar_g_ca_point_limit);
         GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
 
-               if (autocvar_g_ca_team_spawns)
-                       have_team_spawns = -1; // request team spawns
+        GameRules_spawning_teams(autocvar_g_ca_team_spawns);
        }
 
        MUTATOR_ONREMOVE
index 930e93b83c148944a30b7be66bee797055d88394..f54511f2c156ee8f36a2d12d7f7231c1710aa471 100644 (file)
@@ -15,7 +15,6 @@ REGISTER_MUTATOR(ctf, false)
                GameRules_teams(true);
         GameRules_limit_score(autocvar_capturelimit_override);
         GameRules_limit_lead(autocvar_captureleadlimit_override);
-               have_team_spawns = -1; // request team spawns
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index 3fcca2e8991f28344957281168a7facbbffba355..19ba2f9a3f34249632d87f3fac62c46000ab3ef8 100644 (file)
@@ -24,7 +24,6 @@ REGISTER_MUTATOR(dom, false)
                GameRules_teams(true);
         GameRules_limit_score(fraglimit_override);
         GameRules_limit_lead(autocvar_g_domination_point_leadlimit);
-               have_team_spawns = -1; // request team spawns
        }
 
        MUTATOR_ONREMOVE
index 2274180aa8565fa4102969ebb2a5602e3d06d55a..69b857758f7e2cd6f825a368f2e96317a6959301 100644 (file)
@@ -19,8 +19,7 @@ REGISTER_MUTATOR(ft, false)
         GameRules_limit_score(autocvar_g_freezetag_point_limit);
         GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
 
-               if (autocvar_g_freezetag_team_spawns)
-                       have_team_spawns = -1; // request team spawns
+        GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index aad484cbfbac72f0ebd73a00531f4d46e90c4045..1b5853d305fa25af43354ae890bc2847f59d8d01 100644 (file)
@@ -25,8 +25,7 @@ REGISTER_MUTATOR(inv, false)
                if (autocvar_g_invasion_teams >= 2)
                {
                        GameRules_teams(true);
-                       if (autocvar_g_invasion_team_spawns)
-                               have_team_spawns = -1; // request team spawns
+                       GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
                }
        }
 
index 3903caa986b8451842ab6cbc241bf67ed9cdcfe7..5b0fb5bbbddcfda065e6cdb3576d6050cb013929 100644 (file)
@@ -18,8 +18,7 @@ REGISTER_MUTATOR(kh, false)
                GameRules_teams(true);
         GameRules_limit_score(autocvar_g_keyhunt_point_limit);
         GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
-               if (autocvar_g_keyhunt_team_spawns)
-                       have_team_spawns = -1; // request team spawns
+        GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index 84ca96fae3355b0e412054cf5651f3776fca1a99..2dae1012a1efbce26ad778788f59891a0187229f 100644 (file)
@@ -448,8 +448,6 @@ void rc_SetLimits()
                if(race_teams >= 4) teams |= BIT(3);
 
                race_teams = teams; // now set it?
-
-               have_team_spawns = -1; // request team spawns
        }
        else
                race_teams = 0;
index 5946f84a870e2bf4f1cb11bfac9eaa05180e7bf2..bfff9cca1beda3dcf3ec226f0064fea8b239ada9 100644 (file)
@@ -18,8 +18,7 @@ REGISTER_MUTATOR(tdm, false)
                GameRules_teams(true);
                GameRules_limit_score(autocvar_g_tdm_point_limit);
         GameRules_limit_lead(autocvar_g_tdm_point_leadlimit);
-               if (autocvar_g_tdm_team_spawns)
-                       have_team_spawns = -1; // request team spawns
+        GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE