]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix HUD display of TKA ball status
authorMario <mario.mario@y7mail.com>
Tue, 1 Jun 2021 06:48:37 +0000 (16:48 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 1 Jun 2021 06:48:37 +0000 (16:48 +1000)
qcsrc/common/gamemodes/gamemode/tka/cl_tka.qc
qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc
qcsrc/common/gamemodes/gamemode/tka/tka.qh

index eda7c4ff88dbcbbc1bd19499d2b8647a2bafb7c7..d5e74af4ca788e95e2c8590d1cb49e79dd99c5d0 100644 (file)
@@ -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);
 
 }
index 8337cef6706d5e6b614a02b3864815e9876b56d3..f47ccc4071b7eeb8ad4e721c537f313f9290b920 100644 (file)
@@ -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)
index e8682dba6e62fd5b3c65653b566ad4950a82cf8d..33b17ed72fc24cffff0cf91794d055c3cf143bf7 100644 (file)
@@ -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);