diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-01-11 15:16:34 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-01-11 15:16:34 +0000 |
| commit | 6b886e8ed6ae378e0f8e23dda148cb86083d9657 (patch) | |
| tree | 5d19a6e06debaa72bc21d5a730295857f194970d | |
| parent | f29276e8d544f77e6297ece5264b451740f0c19e (diff) | |
| download | zcatch-6b886e8ed6ae378e0f8e23dda148cb86083d9657.tar.gz zcatch-6b886e8ed6ae378e0f8e23dda148cb86083d9657.zip | |
fixed so that the tuning is resetting itself if running a pure server
| -rw-r--r-- | src/game/server/gamecontroller.hpp | 3 | ||||
| -rw-r--r-- | src/game/server/hooks.cpp | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/game/server/gamecontroller.hpp b/src/game/server/gamecontroller.hpp index f3b64a3b..26b8a81f 100644 --- a/src/game/server/gamecontroller.hpp +++ b/src/game/server/gamecontroller.hpp @@ -37,7 +37,6 @@ protected: char map_wish[128]; - const char *gametype; int round_start_tick; int game_over_tick; @@ -53,6 +52,8 @@ protected: bool force_balanced; public: + const char *gametype; + bool is_teamplay() const; GAMECONTROLLER(); diff --git a/src/game/server/hooks.cpp b/src/game/server/hooks.cpp index f4ef4686..8ce2cf56 100644 --- a/src/game/server/hooks.cpp +++ b/src/game/server/hooks.cpp @@ -25,6 +25,21 @@ extern "C" TUNING_PARAMS tuning; +static void check_pure_tuning() +{ + if( strcmp(game.controller->gametype, "DM")==0 || + strcmp(game.controller->gametype, "TDM")==0 || + strcmp(game.controller->gametype, "CTF")==0) + { + TUNING_PARAMS p; + if(memcmp(&p, &tuning, sizeof(TUNING_PARAMS)) != 0) + { + dbg_msg("server", "resetting tuning due to pure server"); + tuning = p; + } + } +} + struct VOTEOPTION { VOTEOPTION *next; @@ -38,6 +53,8 @@ static VOTEOPTION *voteoption_last = 0; void send_tuning_params(int cid) { + check_pure_tuning(); + msg_pack_start(NETMSGTYPE_SV_TUNEPARAMS, MSGFLAG_VITAL); int *params = (int *)&tuning; for(unsigned i = 0; i < sizeof(tuning)/sizeof(int); i++) @@ -62,6 +79,8 @@ void mods_client_predicted_input(int client_id, void *input) // Server hooks void mods_tick() { + check_pure_tuning(); + game.tick(); if(config.dbg_dummies) |