diff options
| author | scosu <scosu@gmx.de> | 2008-10-22 14:31:46 +0000 |
|---|---|---|
| committer | scosu <scosu@gmx.de> | 2008-10-22 14:31:46 +0000 |
| commit | 6d86d949fdfec590e9bed0ff126271ebab81796a (patch) | |
| tree | 3415429ed77a92786ce63134d54eb9593efa7e97 /src/game/server/gamecontroller.cpp | |
| parent | 2e3b6f5c7aa8c55a6380fb9b0440f6476fda88ec (diff) | |
| download | zcatch-6d86d949fdfec590e9bed0ff126271ebab81796a.tar.gz zcatch-6d86d949fdfec590e9bed0ff126271ebab81796a.zip | |
Introduces a command change_map to change maps or restart round with showing the scoreboard ticket:536
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 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; |