]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/samual/playerstats_init_fix'
authorSamual Lenks <samual@xonotic.org>
Fri, 7 Sep 2012 22:50:27 +0000 (18:50 -0400)
committerSamual Lenks <samual@xonotic.org>
Fri, 7 Sep 2012 22:50:27 +0000 (18:50 -0400)
qcsrc/server/g_world.qc
qcsrc/server/playerstats.qc

index 4b5bc74add74a5e7b6f454dd26842d9c302da55b..224f6ce259763962b12b88230dbe4176eef34d14 100644 (file)
@@ -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
index a83c5772f5fc9ebefdf31225443ad3a7a8934faf..68fe031581c1b404f26922855364a07477807a7b 100644 (file)
@@ -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);