]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/playerstats.qc
Merge remote branch 'origin/master' into fruitiex/animations
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / playerstats.qc
index c691d542bb63f2cf4bf44ec2c61ce009faee12c2..7f20b92454db5084718d1ca79df4a4cef219fb76 100644 (file)
@@ -284,10 +284,10 @@ void PlayerStats_AddGlobalInfo(entity p)
 
        // add global info!
        if(p.alivetime)
+       {
                PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
-
-       if(p.alivetime)
-               PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
+               p.alivetime = 0;
+       }
 
        db_put(playerstats_db, sprintf("%s:_netname", p.playerstats_id), ftos(p.playerid));
        
@@ -297,7 +297,7 @@ void PlayerStats_AddGlobalInfo(entity p)
     if(teamplay)
                db_put(playerstats_db, sprintf("%s:_team", p.playerstats_id), ftos(p.team));
 
-       if(p.alivetime > 0)
+       if(stof(db_get(playerstats_db, sprintf("%d:%s", p.playerstats_id, PLAYERSTATS_ALIVETIME))) > 0)
                PlayerStats_Event(p, PLAYERSTATS_JOINS, 1);
 
        strunzone(p.playerstats_id);
@@ -328,7 +328,7 @@ void PlayerStats_EndMatch(float finished)
 {
        entity p, winner;
     winner = PlayerScore_Sort(score_dummyfield);
-       FOR_EACH_PLAYER(p)
+       FOR_EACH_PLAYER(p) // spectators intentionally not included
        {
                PlayerScore_PlayerStats(p);
                PlayerStats_Accuracy(p);