]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix hud_panel_ammo_onlycurrent
authorSamual Lenks <samual@xonotic.org>
Sun, 5 Jan 2014 17:32:33 +0000 (12:32 -0500)
committerSamual Lenks <samual@xonotic.org>
Sun, 5 Jan 2014 17:32:33 +0000 (12:32 -0500)
qcsrc/client/hud.qc

index de4fe077e52f90ed81b4d0a09dac0604e6078dcf..41805d18edfa57cd195790ef9afbe52aa6c04809 100644 (file)
@@ -829,14 +829,28 @@ void HUD_Weapons(void)
 // Ammo (#1)
 void DrawAmmoItem(vector myPos, vector mySize, .float ammotype, float currently_selected, float infinite_ammo)
 {
-       float a;
-       if(autocvar__hud_configure)
+       float a = 0;
+       if(ammotype != ammo_none)
        {
-               currently_selected = (ammotype == ammo_rockets); //rockets always selected
-               a = 60;
+               if(autocvar__hud_configure)
+               {
+                       currently_selected = (ammotype == ammo_rockets); //rockets always selected
+                       a = 60;
+               }
+               else
+               {
+                       // how much ammo do we have of this ammotype?
+                       a = getstati(GetAmmoStat(ammotype));
+               }
        }
        else
-               a = getstati(GetAmmoStat(ammotype)); // how much ammo do we have of type itemcode?
+       {
+               #if 0
+               infinite_ammo = TRUE;
+               #else
+               return; // just don't draw infinite ammo at all.
+               #endif
+       }
 
        vector color;
        if(infinite_ammo)
@@ -946,7 +960,7 @@ void HUD_Ammo(void)
        {
                if(autocvar__hud_configure)
                {
-                       DrawAmmoItem(pos, ammo_size, ammo_rockets, true, FALSE);
+                       DrawAmmoItem(pos, ammo_size, ammo_rockets, TRUE, FALSE);
                }
                else
                {