move the redalive/bluealive checks further up to avoid a return if block
authorFruitieX <rasse@rasse-laptop.(none)>
Sat, 23 Oct 2010 18:35:19 +0000 (21:35 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Sat, 23 Oct 2010 18:35:19 +0000 (21:35 +0300)
qcsrc/server/arena.qc

index 6ffde101c1ae180ce150b8e8de3e4a0cb7492aa5..046743151dbc02fd27dbd706a77d8065418397b6 100644 (file)
@@ -273,16 +273,8 @@ float redalive, bluealive;
  */
 void Spawnqueue_Check()
 {
-       if(time < warmup + 1 || inWarmupStage)
-               return;
-
-       if(g_ca) {
-               // check the amount of spawned players in each team
-               float redspawned, bluespawned;
-               FOR_EACH_PLAYER(self) {
-                       if (self.team == COLOR_TEAM1) redspawned += 1;
-                       else if (self.team == COLOR_TEAM2) bluespawned += 1;
-               }
+       if(g_ca) // we want to perform this before the return block below...
+       {
                // this is STUPID to perform again, but has to be done so that we can give instant feedback when a round ends
                // and so the code won't start searching for a champion using find() before all players are actually REMOVED
                redalive = 0; bluealive = 0;
@@ -296,6 +288,17 @@ void Spawnqueue_Check()
                        self.redalive_stat = redalive;
                        self.bluealive_stat = bluealive;
                }
+       }
+       if(time < warmup + 1 || inWarmupStage)
+               return;
+
+       if(g_ca) {
+               // check the amount of spawned players in each team
+               float redspawned, bluespawned;
+               FOR_EACH_PLAYER(self) {
+                       if (self.team == COLOR_TEAM1) redspawned += 1;
+                       else if (self.team == COLOR_TEAM2) bluespawned += 1;
+               }
 
                required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));