]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
More BITs
authorterencehill <piuntn@gmail.com>
Mon, 22 Mar 2021 14:14:41 +0000 (15:14 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 22 Mar 2021 14:14:41 +0000 (15:14 +0100)
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc
qcsrc/common/weapons/all.qc
qcsrc/server/scores.qc

index 379eb2ee91aeadee414e43b29e23657c5473358e..baa42536d5cf3b331419b0a7a9a2417959814a54 100644 (file)
@@ -855,7 +855,7 @@ int kh_GetMissingTeams()
                                ++players;
                });
                if (!players)
-                       missing_teams |= (2 ** i);
+                       missing_teams |= BIT(i);
        }
        return missing_teams;
 }
index 11ac0641a2c18be823715cd6c17df3d8f975bbb3..e97de364bbab9d96a011e55151de1c59c60eb5dc 100644 (file)
@@ -61,11 +61,11 @@ WepSet _WepSet_FromWeapon(int a)
                                if (a >= 24)
                                {
                                        a -= 24;
-                                       return '0 0 1' * (2 ** a);
+                                       return '0 0 1' * BIT(a);
                                }
-                       return '0 1 0' * (2 ** a);
+                       return '0 1 0' * BIT(a);
                }
-       return '1 0 0' * (2 ** a);
+       return '1 0 0' * BIT(a);
 }
 #ifdef SVQC
        void WriteWepSet(float dst, WepSet w)
index 821c378a84388d3dc941b708a02064f715a4386a..fd2c2cc55439e8dd09d8c2d3cf61f68e23d79f7d 100644 (file)
@@ -130,7 +130,7 @@ float TeamScore_AddToTeam(int t, float scorefield, float score)
        }
        if(score)
                if(teamscores_label(scorefield) != "")
-                       s.SendFlags |= (2 ** scorefield);
+                       s.SendFlags |= BIT(scorefield);
        return (s.(teamscores(scorefield)) += score);
 }
 
@@ -277,7 +277,7 @@ float PlayerScore_Clear(entity player)
        FOREACH(Scores, true, {
                if(sk.(scores(it)) != 0)
                        if(scores_label(it) != "")
-                               sk.SendFlags |= (2 ** (i % 16));
+                               sk.SendFlags |= BIT(i % 16);
                if(i != SP_ELO.m_id)
                        sk.(scores(it)) = 0;
        });
@@ -295,7 +295,7 @@ void Score_ClearAll()
                FOREACH(Scores, true, {
                        if(sk.(scores(it)) != 0)
                                if(scores_label(it) != "")
-                                       sk.SendFlags |= (2 ** (i % 16));
+                                       sk.SendFlags |= BIT(i % 16);
                        if(i != SP_ELO.m_id)
                                sk.(scores(it)) = 0;
                });
@@ -309,7 +309,7 @@ void Score_ClearAll()
                {
                        if(sk.(teamscores(j)) != 0)
                                if(teamscores_label(j) != "")
-                                       sk.SendFlags |= (2 ** j);
+                                       sk.SendFlags |= BIT(j);
                        sk.(teamscores(j)) = 0;
                }
        }
@@ -357,7 +357,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
                return s.(scores(scorefield));
        }
        if(scores_label(scorefield) != "")
-               s.SendFlags |= (2 ** (scorefield.m_id % 16));
+               s.SendFlags |= BIT(scorefield.m_id % 16);
        if(!warmup_stage)
                PlayerStats_GameReport_Event_Player(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        s.(scores(scorefield)) += score;
@@ -382,7 +382,7 @@ float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
                return oldscore;
 
        if(scores_label(scorefield) != "")
-               s.SendFlags |= (2 ** (scorefield.m_id % 16));
+               s.SendFlags |= BIT(scorefield.m_id % 16);
        s.(scores(scorefield)) = score;
        return s.(scores(scorefield));
 }