From 54c98102fd77bb788e8f64d8b747f472c1dc9789 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 17 Nov 2011 21:53:52 +0200 Subject: [PATCH] Fix zero being displayed for empty digits on the Grabber screen (causing 80 ammo to show as 800 for instance) --- data/qcsrc/server/cl_weaponsystem.qc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.39.2