From: FruitieX Date: Sat, 23 Oct 2010 18:35:19 +0000 (+0300) Subject: move the redalive/bluealive checks further up to avoid a return if block X-Git-Tag: xonotic-v0.1.0preview~245^2~8^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03a3889646adbafa500e1a5410edf8283f541962;p=xonotic%2Fxonotic-data.pk3dir.git move the redalive/bluealive checks further up to avoid a return if block --- 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));