From: Samual Lenks Date: Fri, 7 Sep 2012 22:43:58 +0000 (-0400) Subject: Move init for playerstats back behind score initialization.. It's a wonder X-Git-Tag: xonotic-v0.7.0~248^2 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=54317d398d30f051f33bfc28a8eb85df3f4e5b04 Move init for playerstats back behind score initialization.. It's a wonder this worked in the past, makes no sense at all. --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 4b5bc74add..224f6ce259 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -639,6 +639,8 @@ void spawnfunc_worldspawn (void) Map_MarkAsRecent(mapname); + PlayerStats_Init(); // we need this to be initiated before InitGameplayMode + precache_model ("null"); // we need this one before InitGameplayMode InitGameplayMode(); readlevelcvars(); @@ -912,8 +914,6 @@ void spawnfunc_worldspawn (void) cvar_set("sv_curl_serverpackages", substring(s, 1, -1)); } - PlayerStats_Init(); - // MOD AUTHORS: change this, and possibly remove a few of the blocks below to ignore certain changes modname = "Xonotic"; // physics/balance/config changes that count as mod diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index a83c5772f5..68fe031581 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -5,7 +5,7 @@ string events_last; .float playerstats_addedglobalinfo; .string playerstats_id; -void PlayerStats_Init() +void PlayerStats_Init() // initiated before InitGameplayMode so that scores are added properly { string uri; playerstats_db = -1; @@ -17,7 +17,7 @@ void PlayerStats_Init() if(playerstats_db >= 0) playerstats_waitforme = FALSE; // must wait for it at match end - serverflags |= SERVERFLAG_PLAYERSTATS; + serverflags |= SERVERFLAG_PLAYERSTATS; PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME); PlayerStats_AddEvent(PLAYERSTATS_WINS); @@ -124,7 +124,7 @@ void PlayerStats_AddEvent(string event_id) { if(playerstats_db < 0) return; - + string key; key = sprintf("*:%s", event_id);