From: terencehill Date: Sun, 1 Jan 2012 23:05:30 +0000 (+0100) Subject: Avoid counting another time players of each CA team when detecting if teams are ok... X-Git-Tag: xonotic-v0.6.0~42^2~7^2~18 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=bc464cf995b26a55ceab9c6bab4a83f7a65701fe;p=xonotic%2Fxonotic-data.pk3dir.git Avoid counting another time players of each CA team when detecting if teams are ok (thanks to the previous commit we can call the code to count players before Arena_Warmup) --- diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index 6eaff6b79..2f85d0d71 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -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; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 2497b9d50..16678e677 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -201,6 +201,9 @@ void StartFrame (void) skill = autocvar_skill; + count_players(); + if(g_ca || g_freezetag) + count_alive_players(); Arena_Warmup(); Spawnqueue_Check();