fixed bug that crashes the server if settings tunings in the server config

This commit is contained in:
Magnus Auvinen 2009-01-12 21:44:13 +00:00
parent 123c5b5b99
commit 70dea7e398
2 changed files with 6 additions and 1 deletions

View file

@ -10,6 +10,7 @@ GAMECONTEXT::GAMECONTEXT()
for(int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
players[i] = 0; players[i] = 0;
controller = 0;
vote_closetime = 0; vote_closetime = 0;
} }

View file

@ -27,6 +27,10 @@ TUNING_PARAMS tuning;
static void check_pure_tuning() static void check_pure_tuning()
{ {
// might not be created yet during start up
if(!game.controller)
return;
if( strcmp(game.controller->gametype, "DM")==0 || if( strcmp(game.controller->gametype, "DM")==0 ||
strcmp(game.controller->gametype, "TDM")==0 || strcmp(game.controller->gametype, "TDM")==0 ||
strcmp(game.controller->gametype, "CTF")==0) strcmp(game.controller->gametype, "CTF")==0)