From 6dcea2c4ca59e0f1ac8450cc31550bdb35bc21b1 Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Sun, 7 Sep 2008 08:10:56 +0000 Subject: mermerge from 0.4.3: auto team balancing --- src/game/server/entities/character.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/game/server/entities') diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 5c307e62..463b6640 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -62,6 +62,7 @@ bool CHARACTER::spawn(PLAYER *player, vec2 pos, int team) game.world.insert_entity(this); alive = true; + player->force_balanced = false; game.controller->on_character_spawn(this); @@ -563,6 +564,15 @@ void CHARACTER::tick() return; } * */ + + if(player->force_balanced) + { + char buf[128]; + str_format(buf, sizeof(buf), "You were moved to %s due to team balancing", game.controller->get_team_name(team)); + game.send_broadcast(buf, player->client_id); + + player->force_balanced = false; + } //player_core core; //core.pos = pos; -- cgit 1.4.1