]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
First functionality of the Grabber screen. Weapon load is now displayed properly...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 17:26:45 +0000 (19:26 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 17:26:45 +0000 (19:26 +0200)
data/qcsrc/server/cl_weaponsystem.qc

index 60bcbec6a2f7cd4d2b8f974e146f3c0e262181e6..2781dea09c8e612a37e675ec4d45322743d3c66e 100644 (file)
@@ -1591,7 +1591,7 @@ void W_DisplayDigitThink()
        }\r
 \r
        entity gun;\r
-       if(self.team) // exterior weapon\r
+       if(self.wait) // exterior weapon\r
        {\r
                // keep the digit attached to the same bone as the gun\r
                setattachment(self, self.owner, "bip01 r hand");\r
@@ -1618,6 +1618,14 @@ void W_DisplayDigitThink()
        self.colormod = gun.colormod; // used by the regurgitating colors\r
        self.glowmod = gun.glowmod;\r
 \r
+       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
+       }\r
+\r
        self.nextthink = time;\r
 }\r
 \r
@@ -1627,19 +1635,19 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior)
        digit = spawn();\r
        digit.owner = own;\r
        digit.weapon = own.switchweapon;\r
-       digit.team = exterior;\r
+       digit.wait = exterior;\r
+       digit.team = load;\r
+       digit.cnt = num;\r
        e = get_weaponinfo(digit.weapon);\r
 \r
        if(load)\r
        {\r
                // weapon load digit\r
-               digit.cnt = 0;\r
                setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit1-", ftos(num) , ".md3"));\r
        }\r
        else\r
        {\r
                // ammo count digit\r
-               digit.cnt = 1;\r
                setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(num) , ".md3"));\r
        }\r
        digit.think = W_DisplayDigitThink;\r