]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Argh I hate FTEQCC... Fix the bug and recommit from the revert (which was WRONG)
authorSamual Lenks <samual@xonotic.org>
Sun, 9 Sep 2012 17:11:12 +0000 (13:11 -0400)
committerSamual Lenks <samual@xonotic.org>
Sun, 9 Sep 2012 17:11:12 +0000 (13:11 -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 a63f59403721b46ca4d5b5b907cedf1d112050bd..c94a5f22ac4262c8dc751b850ffa8cbcb9433100 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;
@@ -236,7 +236,7 @@ void PlayerStats_ready(entity fh, entity pass, float status)
        switch(status)
        {
                case URL_READY_CANWRITE:
-                       url_fputs(fh, "V 3\n");
+                       url_fputs(fh, "V 4\n");
 #ifdef WATERMARK
                        url_fputs(fh, sprintf("R %s\n", WATERMARK()));
 #endif
@@ -387,10 +387,8 @@ void PlayerStats_EndMatch(float finished)
        {
                //PlayerStats_Accuracy(p); // stats are already written with PlayerStats_AddGlobalInfo(entity), don't double them up.
                
-               if(g_arena || g_lms || g_ca)
-                       if(p.alivetime <= 0) { continue; }
-               else
-                       if(p.classname != "player") { continue; }
+               if((g_arena || g_lms || g_ca) && (p.alivetime <= 0)) { continue; }
+               else if(p.classname != "player") { continue; }
                        
                PlayerScore_PlayerStats(p);
                PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1);