From 03a3889646adbafa500e1a5410edf8283f541962 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sat, 23 Oct 2010 21:35:19 +0300 Subject: [PATCH] move the redalive/bluealive checks further up to avoid a return if block --- qcsrc/server/arena.qc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index 6ffde101c..046743151 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -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)); -- 2.39.2