From: Mario Date: Thu, 30 Jun 2016 22:18:31 +0000 (+1000) Subject: Don't show weapon ammo bars if unlimited ammo is enabled X-Git-Tag: xonotic-v0.8.2~700^2~110 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=56d045f21f4faab05f3b5ae83319cd7942c0e85e;p=xonotic%2Fxonotic-data.pk3dir.git Don't show weapon ammo bars if unlimited ammo is enabled --- 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?