From 4df185105db8d0056fe843a3b8944bd725faea98 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 1 Jun 2021 16:48:37 +1000 Subject: [PATCH] Fix HUD display of TKA ball status --- qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc | 6 +++--- qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc | 2 +- qcsrc/common/gamemodes/gamemode/tka/tka.qh | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc b/qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc index eda7c4ff88..d5e74af4ca 100644 --- a/qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc +++ b/qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc @@ -45,11 +45,11 @@ void HUD_Mod_TeamKeepaway(vector pos, vector mySize) drawpic_aspect_skin(pos, "keepawayball_carrying", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL); else if(stat_items & TKA_BALL_TAKEN_RED) drawpic_aspect_skin(pos, "tka_taken_red", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL); - else if(stat_items & TKA_BALL_TAKEN_RED) + else if(stat_items & TKA_BALL_TAKEN_BLUE) drawpic_aspect_skin(pos, "tka_taken_blue", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL); - else if(stat_items & TKA_BALL_TAKEN_RED) + else if(stat_items & TKA_BALL_TAKEN_YELLOW) drawpic_aspect_skin(pos, "tka_taken_yellow", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL); - else if(stat_items & TKA_BALL_TAKEN_RED) + else if(stat_items & TKA_BALL_TAKEN_PINK) drawpic_aspect_skin(pos, "tka_taken_pink", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * tkaball_alpha * f, DRAWFLAG_NORMAL); } diff --git a/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc b/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc index 8337cef670..f47ccc4071 100644 --- a/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc +++ b/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc @@ -372,7 +372,7 @@ MUTATOR_HOOKFUNCTION(tka, PlayerPreThink) entity player = M_ARGV(0, entity); // clear the item used for the ball in keepaway - STAT(TKA_BALLSTATUS, player) &= ~(TKA_BALL_TAKEN_RED | TKA_BALL_TAKEN_BLUE | TKA_BALL_TAKEN_YELLOW | TKA_BALL_TAKEN_PINK | TKA_BALL_CARRYING | TKA_BALL_DROPPED); + STAT(TKA_BALLSTATUS, player) = 0; // if the player has the ball, make sure they have the item for it (Used for HUD primarily) if(player.ballcarried) diff --git a/qcsrc/common/gamemodes/gamemode/tka/tka.qh b/qcsrc/common/gamemodes/gamemode/tka/tka.qh index e8682dba6e..33b17ed72f 100644 --- a/qcsrc/common/gamemodes/gamemode/tka/tka.qh +++ b/qcsrc/common/gamemodes/gamemode/tka/tka.qh @@ -51,9 +51,9 @@ CLASS(TeamKeepaway, Gametype) ENDCLASS(TeamKeepaway) REGISTER_GAMETYPE(TEAMKEEPAWAY, NEW(TeamKeepaway)); -const int TKA_BALL_TAKEN_RED = 1; -const int TKA_BALL_TAKEN_BLUE = 2; -const int TKA_BALL_TAKEN_YELLOW = 3; -const int TKA_BALL_TAKEN_PINK = 4; -const int TKA_BALL_CARRYING = 8; -const int TKA_BALL_DROPPED = 12; +const int TKA_BALL_TAKEN_RED = BIT(0); +const int TKA_BALL_TAKEN_BLUE = BIT(1); +const int TKA_BALL_TAKEN_YELLOW = BIT(2); +const int TKA_BALL_TAKEN_PINK = BIT(3); +const int TKA_BALL_CARRYING = BIT(4); +const int TKA_BALL_DROPPED = BIT(5); -- 2.39.2