]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/playerstats.qc
playerstats: properly handle different ways of match ending
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / playerstats.qc
index a8efa82c8ebfb1808cfb2d8e4302fb9028ae4359..2d1e2191203deb48ab93572a7f9b40f9b537ee6f 100644 (file)
@@ -179,13 +179,16 @@ void PlayerStats_AddGlobalInfo(entity p)
        p.playerstats_id = string_null;
 }
 
-void PlayerStats_EndMatch()
+void PlayerStats_EndMatch(float finished)
 {
        entity p;
        FOR_EACH_PLAYER(p)
        {
                PlayerScore_PlayerStats(p);
-               PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning);
-               PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1);
+               if(finished)
+               {
+                       PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning);
+                       PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1);
+               }
        }
 }