]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Avoid counting another time players of each CA team when detecting if teams are ok...
authorterencehill <piuntn@gmail.com>
Sun, 1 Jan 2012 23:05:30 +0000 (00:05 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 1 Jan 2012 23:05:30 +0000 (00:05 +0100)
qcsrc/server/arena.qc
qcsrc/server/sv_main.qc

index 6eaff6b79522c5eaeedc33ad2588e414dc561485..2f85d0d7128ed1268e002ba0d925dac631d93419 100644 (file)
@@ -269,18 +269,8 @@ void Arena_Warmup()
                FOR_EACH_PLAYER(e)
                        Send_CSQC_Centerprint_Generic(e, CPID_ROUND_STARTING, "^1Begin!", 1, 0);
 
-               if(g_ca) {
-                       float start_red_ca_players, start_blue_ca_players;
-
-                       FOR_EACH_PLAYER(e) {
-                               if (e.team == COLOR_TEAM1)
-                                       start_red_ca_players += 1;
-                               else if (e.team == COLOR_TEAM2)
-                                       start_blue_ca_players += 1;
-                       }
-                       // teams are ok if there's at least 1 player in each team
-                       ca_teams_ok = (start_red_ca_players && start_blue_ca_players);
-               }
+               if(g_ca)
+                       ca_teams_ok = (red_players && blue_players); // teams are ok if there's at least 1 player in each team
 
                FOR_EACH_PLAYER(e)
                {
@@ -389,11 +379,6 @@ void count_alive_players()
 float warntime;
 void Spawnqueue_Check()
 {
-       count_players();
-       if(g_ca || g_freezetag) // we want to perform this before the return block below (CA)...
-       {
-               count_alive_players();
-       }
        if(time < warmup + 1 || inWarmupStage || intermission_running)
                return;
 
index 2497b9d502854f663d65f3fd6779c54d723a46f5..16678e67743197c870cc7dacaa80fcd83fe13a55 100644 (file)
@@ -201,6 +201,9 @@ void StartFrame (void)
 
        skill = autocvar_skill;
 
+       count_players();
+       if(g_ca || g_freezetag)
+               count_alive_players();
        Arena_Warmup();
        Spawnqueue_Check();