From 56d045f21f4faab05f3b5ae83319cd7942c0e85e Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 1 Jul 2016 08:18:31 +1000 Subject: [PATCH] Don't show weapon ammo bars if unlimited ammo is enabled --- qcsrc/client/hud/panel/weapons.qc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 984cb4f50..a30006c26 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -56,6 +56,8 @@ void HUD_Weapons() float when = max(1, autocvar_hud_panel_weapons_complainbubble_time); float fadetime = max(0, autocvar_hud_panel_weapons_complainbubble_fadetime); + bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO); + vector weapon_pos, weapon_size = '0 0 0'; vector color; @@ -330,7 +332,7 @@ void HUD_Weapons() } // calculate position/size for visual bar displaying ammount of ammo status - if (autocvar_hud_panel_weapons_ammo) + if (!infinite_ammo && autocvar_hud_panel_weapons_ammo) { ammo_color = stov(autocvar_hud_panel_weapons_ammo_color); ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha; @@ -466,7 +468,7 @@ void HUD_Weapons() } // draw ammo status bar - if(autocvar_hud_panel_weapons_ammo && (it.ammo_field != ammo_none)) + if(!infinite_ammo && autocvar_hud_panel_weapons_ammo && (it.ammo_field != ammo_none)) { float ammo_full; a = getstati(GetAmmoStat(it.ammo_field)); // how much ammo do we have? -- 2.39.2