From eba5226174da87c85d867b7a580ae761330f6767 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 22 Mar 2021 15:14:41 +0100 Subject: [PATCH] More BITs --- .../common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc | 2 +- qcsrc/common/weapons/all.qc | 6 +++--- qcsrc/server/scores.qc | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc index 379eb2ee9..baa42536d 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc @@ -855,7 +855,7 @@ int kh_GetMissingTeams() ++players; }); if (!players) - missing_teams |= (2 ** i); + missing_teams |= BIT(i); } return missing_teams; } diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 11ac0641a..e97de364b 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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) diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 821c378a8..fd2c2cc55 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -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)); } -- 2.39.2