]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc
Fix FL_WEAPON flag overlapping FL_JUMPRELEASED. This unintentional change was introdu...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / nexball / cl_nexball.qc
index fa7be6e5072bb003ef7b996cc2cb04a5c928ee51..935232cdf378f602ee463ceebc352f5ded3efc47 100644 (file)
@@ -6,30 +6,24 @@
 // Nexball HUD mod icon
 void HUD_Mod_NexBall(vector pos, vector mySize)
 {
-       float nb_pb_starttime, dt, p;
-       int stat_items;
+       int stat_items = STAT(OBJECTIVE_STATUS);
+       float nb_pb_starttime = STAT(NB_METERSTART);
 
-       stat_items = STAT(ITEMS);
-       nb_pb_starttime = STAT(NB_METERSTART);
-
-       if (stat_items & IT_KEY1)
-               mod_active = 1;
-       else
-               mod_active = 0;
+       mod_active = (stat_items & NB_CARRYING);
 
        //Manage the progress bar if any
        if (nb_pb_starttime > 0)
        {
-               dt = (time - nb_pb_starttime) % nb_pb_period;
+               float dt = (time - nb_pb_starttime) % nb_pb_period;
                // one period of positive triangle
-               p = 2 * dt / nb_pb_period;
+               float p = 2 * dt / nb_pb_period;
                if (p > 1)
                        p = 2 - p;
 
                HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, (mySize.x <= mySize.y), 0, autocvar_hud_progressbar_nexball_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 
-       if (stat_items & IT_KEY1)
+       if (stat_items & NB_CARRYING)
                drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 }