]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix zero being displayed for empty digits on the Grabber screen (causing 80 ammo...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 19:53:52 +0000 (21:53 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 19:53:52 +0000 (21:53 +0200)
data/qcsrc/server/cl_weaponsystem.qc

index 2d55ff26048edf2c733a471a45294c2229afdfaa..3ba9de44e1458cda731d0ca0223e2249f75a4094 100644 (file)
@@ -1622,21 +1622,24 @@ void W_DisplayDigitThink()
        if(self.team) // weapon load display\r
        {\r
                if(self.owner.weapon_load[self.owner.switchweapon] <= 0)\r
-                       self.skin = 10; // unavailable\r
+                       self.skin = 11; // unavailable digit\r
                else\r
                {\r
                        txt = ftos(self.owner.weapon_load[self.owner.switchweapon]);\r
                        txt = substring(txt, self.cnt - 1, 1);\r
-                       self.skin = stof(txt);\r
                }\r
        }\r
        else // ammo display\r
        {\r
                txt = ftos(self.owner.(self.owner.current_ammo));\r
                txt = substring(txt, self.cnt - 1, 1);\r
-               self.skin = stof(txt);\r
        }\r
 \r
+       if(!txt || txt == "")\r
+               self.skin = 10; // empty digit\r
+       else\r
+               self.skin = stof(txt);\r
+\r
        self.nextthink = time;\r
 }\r
 \r