From: MirceaKitsune Date: Thu, 17 Nov 2011 19:53:52 +0000 (+0200) Subject: Fix zero being displayed for empty digits on the Grabber screen (causing 80 ammo... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=54c98102fd77bb788e8f64d8b747f472c1dc9789;p=voretournament%2Fvoretournament.git Fix zero being displayed for empty digits on the Grabber screen (causing 80 ammo to show as 800 for instance) --- diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index 2d55ff26..3ba9de44 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -1622,21 +1622,24 @@ void W_DisplayDigitThink() if(self.team) // weapon load display { if(self.owner.weapon_load[self.owner.switchweapon] <= 0) - self.skin = 10; // unavailable + self.skin = 11; // unavailable digit else { txt = ftos(self.owner.weapon_load[self.owner.switchweapon]); txt = substring(txt, self.cnt - 1, 1); - self.skin = stof(txt); } } else // ammo display { txt = ftos(self.owner.(self.owner.current_ammo)); txt = substring(txt, self.cnt - 1, 1); - self.skin = stof(txt); } + if(!txt || txt == "") + self.skin = 10; // empty digit + else + self.skin = stof(txt); + self.nextthink = time; }