From 6d86d949fdfec590e9bed0ff126271ebab81796a Mon Sep 17 00:00:00 2001 From: scosu Date: Wed, 22 Oct 2008 14:31:46 +0000 Subject: Introduces a command change_map to change maps or restart round with showing the scoreboard ticket:536 --- 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 ea76e897..44bb2893 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -25,6 +25,7 @@ GAMECONTROLLER::GAMECONTROLLER() game_flags = 0; teamscore[0] = 0; teamscore[1] = 0; + map_wish[0] = 0; unbalanced_tick = -1; force_balanced = false; @@ -200,8 +201,21 @@ void GAMECONTROLLER::startround() round_count++; } +void GAMECONTROLLER::change_map(const char *to_map) +{ + str_copy(map_wish, to_map, sizeof(map_wish)); + endround(); +} + void GAMECONTROLLER::cyclemap() { + if(map_wish[0] != 0) + { + dbg_msg("game", "rotating map to %s", map_wish); + str_copy(config.sv_map, map_wish, sizeof(config.sv_map)); + map_wish[0] = 0; + return; + } if(!strlen(config.sv_maprotation)) return; -- cgit 1.4.1