mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed so that the tuning is resetting itself if running a pure server
This commit is contained in:
parent
f29276e8d5
commit
6b886e8ed6
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue