From a92c6d44dcb62675cf1937e1e618e50010345ac7 Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Sun, 7 Sep 2008 08:57:59 +0000 Subject: merge from 0.4.3: notification on auto team balance --- src/game/server/gamecontroller.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/game/server/gamecontroller.cpp') diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 4c3c121b..bf4f5451 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -27,6 +27,7 @@ GAMECONTROLLER::GAMECONTROLLER() teamscore[1] = 0; unbalanced_tick = -1; + force_balanced = false; num_spawn_points[0] = 0; num_spawn_points[1] = 0; @@ -191,6 +192,7 @@ void GAMECONTROLLER::startround() teamscore[0] = 0; teamscore[1] = 0; unbalanced_tick = -1; + force_balanced = false; round_count++; } @@ -324,6 +326,17 @@ bool GAMECONTROLLER::is_friendly_fire(int cid1, int cid2) return false; } +bool GAMECONTROLLER::is_force_balanced() +{ + if(force_balanced) + { + force_balanced = false; + return true; + } + else + return false; +} + void GAMECONTROLLER::tick() { // do warmup @@ -385,6 +398,7 @@ void GAMECONTROLLER::tick() p->force_balanced = true; } while (--num_balance); + force_balanced = true; unbalanced_tick = -1; } -- cgit 1.4.1