]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Show the minus symbol while the weapon is being reloaded, or reloading is disabled...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 17:31:07 +0000 (19:31 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 17:31:07 +0000 (19:31 +0200)
data/qcsrc/server/cl_weaponsystem.qc

index 2781dea09c8e612a37e675ec4d45322743d3c66e..015fb264c934fc9ee187fc5f5f7dce32be575224 100644 (file)
@@ -1591,7 +1591,7 @@ void W_DisplayDigitThink()
        }\r
 \r
        entity gun;\r
-       if(self.wait) // exterior weapon\r
+       if(self.dmg) // exterior weapon\r
        {\r
                // keep the digit attached to the same bone as the gun\r
                setattachment(self, self.owner, "bip01 r hand");\r
@@ -1621,9 +1621,14 @@ void W_DisplayDigitThink()
        string txt;\r
        if(self.team) // weapon load display\r
        {\r
-               txt = ftos(self.owner.weapon_load[self.owner.switchweapon]);\r
-               txt = substring(txt, self.cnt - 1, 1);\r
-               self.skin = stof(txt); // if it's not a float it becomes 0\r
+               if(self.owner.weapon_load[self.owner.switchweapon] <= 0)\r
+                       self.skin = 10; // unavailable\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
 \r
        self.nextthink = time;\r
@@ -1635,7 +1640,7 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior)
        digit = spawn();\r
        digit.owner = own;\r
        digit.weapon = own.switchweapon;\r
-       digit.wait = exterior;\r
+       digit.dmg = exterior;\r
        digit.team = load;\r
        digit.cnt = num;\r
        e = get_weaponinfo(digit.weapon);\r