]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Remove uses of Static_Team_ColorName
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 6ece837e83f23960e6bd847e65d89cfc10967beb..ad00c5437d4765da3a3bc56e22e4cadd4f2558c5 100644 (file)
@@ -1,4 +1,10 @@
 #include "scores.qh"
+#include "_all.qh"
+
+#include "command/common.qh"
+#include "mutators/mutators_include.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
 
 .entity scorekeeper;
 entity teamscorekeepers[16];
@@ -18,29 +24,29 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
                return previous;
        if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
                return previous;
-       if(t1.field == t2.field)
+       if (t1.(field) == t2.(field))
                return previous;
 
-       previous_y = fieldflags & SFL_SORT_PRIO_MASK;
+       previous.y = fieldflags & SFL_SORT_PRIO_MASK;
 
        if(fieldflags & SFL_ZERO_IS_WORST)
        {
-               if(t1.field == 0)
+               if (t1.(field) == 0)
                {
-                       previous_x = -1;
+                       previous.x = -1;
                        return previous;
                }
-               else if(t2.field == 0)
+               else if (t2.(field) == 0)
                {
-                       previous_x = +1;
+                       previous.x = +1;
                        return previous;
                }
        }
 
-       if(fieldflags & SFL_LOWER_IS_BETTER)
-               previous_x = (t2.field - t1.field);
+       if (fieldflags & SFL_LOWER_IS_BETTER)
+               previous.x = (t2.(field) - t1.(field));
        else
-               previous_x = (t1.field - t2.field);
+               previous.x = (t1.(field) - t2.(field));
 
        return previous;
 }
@@ -50,7 +56,7 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
  */
 
 float TeamScore_SendEntity(entity to, float sendflags)
-{
+{SELFPARAM();
        float i, p, longflags;
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
@@ -138,8 +144,8 @@ float TeamScore_Compare(entity t1, entity t2, float strict)
                result = ScoreField_Compare(t1, t2, f, teamscores_flags[i], result, strict);
        }
 
-       if (result_x == 0 && strict)
-               result_x = t1.team - t2.team;
+       if (result.x == 0 && strict)
+               result.x = t1.team - t2.team;
 
        return result.x;
 }
@@ -180,7 +186,7 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
        }
 }
 
-float ScoreInfo_SendEntity(entity to, float sf)
+float ScoreInfo_SendEntity(entity to, int sf)
 {
        float i;
        WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
@@ -225,7 +231,7 @@ void ScoreInfo_Init(float teams)
  */
 
 float PlayerScore_SendEntity(entity to, float sendflags)
-{
+{SELFPARAM();
        float i, p, longflags;
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES);
@@ -375,8 +381,8 @@ float PlayerScore_Compare(entity t1, entity t2, float strict)
                result = ScoreField_Compare(t1, t2, f, scores_flags[i], result, strict);
        }
 
-       if (result_x == 0 && strict)
-               result_x = num_for_edict(t1.owner) - num_for_edict(t2.owner);
+       if (result.x == 0 && strict)
+               result.x = num_for_edict(t1.owner) - num_for_edict(t2.owner);
 
        return result.x;
 }
@@ -699,7 +705,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
        plist = world;
 
        FOR_EACH_CLIENT(p)
-               p.field = 0;
+               p.(field) = 0;
 
        FOR_EACH_CLIENT(p) if(p.scorekeeper)
        {
@@ -739,7 +745,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
                if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
                        j = i;
 
-               pbest.field = j;
+               pbest.(field) = j;
 
                if (!pfirst)
                        pfirst = pbest;
@@ -835,7 +841,7 @@ void Score_NicePrint_Player(entity to, entity p, float w)
        sk = p.scorekeeper;
 
        s = strcat(s, p.netname);
-       for(0;;)
+       for (;;)
        {
                i = strlennocol(s) - NAMEWIDTH;
                if(i > 0)