diff options
| author | Alfred Eriksson <somerunce@gmail.com> | 2008-09-07 08:57:59 +0000 |
|---|---|---|
| committer | Alfred Eriksson <somerunce@gmail.com> | 2008-09-07 08:57:59 +0000 |
| commit | a92c6d44dcb62675cf1937e1e618e50010345ac7 (patch) | |
| tree | 690b97b435c2eddd1640fd160bd3fbb05f92f354 /src/game/server/gamecontroller.cpp | |
| parent | 777e685a2467c7b1b3b3c6f3626048d71a41690b (diff) | |
| download | zcatch-a92c6d44dcb62675cf1937e1e618e50010345ac7.tar.gz zcatch-a92c6d44dcb62675cf1937e1e618e50010345ac7.zip | |
merge from 0.4.3: notification on auto team balance
Diffstat (limited to 'src/game/server/gamecontroller.cpp')
| -rw-r--r-- | src/game/server/gamecontroller.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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; } |