]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 042d450ec98e9a74c41e92d1c54a42230fc71770..11bc60238252bb071cbade6518384a3ac8cbb47c 100644 (file)
@@ -54,7 +54,7 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
 
 bool TeamScore_SendEntity(entity this, entity to, float sendflags)
 {
-       float i, p, longflags;
+       float i, longflags;
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
        int t = this.team - 1;
@@ -62,9 +62,9 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags)
        WriteByte(MSG_ENTITY, t);
 
        longflags = 0;
-       for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
+       for(i = 0; i < MAX_TEAMSCORE; ++i)
                if(this.(teamscores(i)) > 127 || this.(teamscores(i)) <= -128)
-                       longflags |= p;
+                       longflags |= BIT(i);
 
 #if MAX_TEAMSCORE <= 8
        WriteByte(MSG_ENTITY, sendflags);
@@ -73,10 +73,10 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags)
        WriteShort(MSG_ENTITY, sendflags);
        WriteShort(MSG_ENTITY, longflags);
 #endif
-       for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
-               if(sendflags & p)
+       for(i = 0; i < MAX_TEAMSCORE; ++i)
+               if(sendflags & BIT(i))
                {
-                       if(longflags & p)
+                       if(longflags & BIT(i))
                                WriteInt24_t(MSG_ENTITY, this.(teamscores(i)));
                        else
                                WriteChar(MSG_ENTITY, this.(teamscores(i)));
@@ -454,7 +454,7 @@ void WinningConditionHelper(entity this)
                WinningConditionHelper_second = NULL;
                winnerscorekeeper = NULL;
                secondscorekeeper = NULL;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        sk = CS(it).scorekeeper;
                        c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
                        if(c < 0)
@@ -473,7 +473,7 @@ void WinningConditionHelper(entity this)
                                        secondscorekeeper = sk;
                                }
                        }
-               ));
+               });
 
                WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
                if(WinningConditionHelper_equality)
@@ -515,7 +515,7 @@ void WinningConditionHelper(entity this)
                strunzone(worldstatus);
        worldstatus = strzone(s);
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                string s = "";
                if(fullstatus)
                {
@@ -535,7 +535,7 @@ void WinningConditionHelper(entity this)
                if(it.clientstatus)
                        strunzone(it.clientstatus);
                it.clientstatus = strzone(s);
-       ));
+       });
 }
 
 string GetScoreLogLabel(string label, float fl)
@@ -694,7 +694,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
 
        plist = NULL;
 
-       FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
+       FOREACH_CLIENT(true, { it.(field) = 0; });
 
        FOREACH_CLIENT(CS(it).scorekeeper,
        {
@@ -894,12 +894,12 @@ void Score_NicePrint(entity to)
        }
 
        t = 0;
-       FOREACH_CLIENT(!IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(!IS_PLAYER(it), {
                if (!t)
                        Score_NicePrint_Spectators(to);
                Score_NicePrint_Spectator(to, it);
                t = 1;
-       ));
+       });
 }
 
 void PlayerScore_PlayerStats(entity p)