]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Possibly fix compilation unit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index c0ebfc54a6335da48be50c0798035412cd1cf797..6bfb09cc97a2978be06048928dbf4366a675a6c2 100644 (file)
@@ -5,6 +5,7 @@
 #include <common/net_linked.qh>
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
+#include <common/scores.qh>
 
 .entity scorekeeper;
 entity teamscorekeepers[16];
@@ -266,7 +267,8 @@ float PlayerScore_Clear(entity player)
                if(sk.(scores(it)) != 0)
                        if(scores_label(it) != "")
                                sk.SendFlags |= (2 ** (i % 16));
-               sk.(scores(it)) = 0;
+               if(i != SP_ELO.m_id)
+                       sk.(scores(it)) = 0;
        });
 
        return 1;
@@ -283,7 +285,8 @@ void Score_ClearAll()
                        if(sk.(scores(it)) != 0)
                                if(scores_label(it) != "")
                                        sk.SendFlags |= (2 ** (i % 16));
-                       sk.(scores(it)) = 0;
+                       if(i != SP_ELO.m_id)
+                               sk.(scores(it)) = 0;
                });
        });
        for(t = 0; t < 16; ++t)
@@ -337,9 +340,12 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
                LOG_WARN("Adding score to unknown player!");
                return 0;
        }
-       if(score)
-               if(scores_label(scorefield) != "")
-                       s.SendFlags |= (2 ** (scorefield.m_id % 16));
+       if(!score)
+       {
+               return s.(scores(scorefield));
+       }
+       if(scores_label(scorefield) != "")
+               s.SendFlags |= (2 ** (scorefield.m_id % 16));
        if(!warmup_stage)
                PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        return (s.(scores(scorefield)) += score);