From 6b886e8ed6ae378e0f8e23dda148cb86083d9657 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 11 Jan 2009 15:16:34 +0000 Subject: fixed so that the tuning is resetting itself if running a pure server --- src/game/server/gamecontroller.hpp | 3 ++- src/game/server/hooks.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) 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) -- cgit 1.4.1