From: Samual Lenks Date: Sun, 5 Jan 2014 17:32:33 +0000 (-0500) Subject: Fix hud_panel_ammo_onlycurrent X-Git-Tag: xonotic-v0.8.0~152^2~131 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=26ffec9cc982601cf08787d05bcd6e91751307db;p=xonotic%2Fxonotic-data.pk3dir.git Fix hud_panel_ammo_onlycurrent --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index de4fe077e..41805d18e 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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 {