]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Enable display digits for exterior weapon too (so you won't see a hole in the screen...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 16:30:25 +0000 (18:30 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 16:30:25 +0000 (18:30 +0200)
data/qcsrc/server/cl_weaponsystem.qc

index e4fc0bd858b5b26558bc4510d2a0d7cfe1d5c5d3..f78d20f7375f35e858987f1699c8574b1a2a9177 100644 (file)
@@ -1590,27 +1590,44 @@ void W_DisplayThink()
                return;\r
        }\r
 \r
-       if(gettagindex(self.owner.weaponentity, "weapon"))\r
-               setattachment(self, self.owner.weaponentity, "weapon");\r
-       else if(gettagindex(self.owner.weaponentity, "tag_weapon"))\r
-               setattachment(self, self.owner.weaponentity, "tag_weapon");\r
-       self.origin_z = self.owner.weaponentity.weaponentity.origin_z;\r
-       self.scale = self.owner.weaponentity.weaponentity.scale;\r
-       self.effects = self.owner.weaponentity.weaponentity.effects;\r
-       self.alpha = self.owner.weaponentity.weaponentity.alpha;\r
-       self.colormap = self.owner.weaponentity.weaponentity.colormap;\r
-       self.colormod = self.owner.weaponentity.weaponentity.colormod; // used by the regurgitating colors\r
-       self.glowmod = self.owner.weaponentity.weaponentity.glowmod;\r
+       entity gun;\r
+       if(self.team) // exterior weapon model\r
+       {\r
+               // keep the digit attached to the same bone as the weapon model\r
+               setattachment(self, self.owner, "bip01 r hand");\r
+               gun = self.owner.exteriorweaponentity;\r
+       }\r
+       else\r
+       {\r
+               // keep the digit attached to the same bone as the weapon model\r
+               // TODO: Does this work with self-animated weapons too?\r
+               if(gettagindex(self.owner.weaponentity, "weapon"))\r
+                       setattachment(self, self.owner.weaponentity, "weapon");\r
+               else if(gettagindex(self.owner.weaponentity, "tag_weapon"))\r
+                       setattachment(self, self.owner.weaponentity, "tag_weapon");\r
+               gun = self.owner.weaponentity.weaponentity;\r
+       }\r
+\r
+       // copy all properties of the weapon model to the digit\r
+       self.origin = gun.origin;\r
+       self.angles = gun.angles;\r
+       self.scale = gun.scale;\r
+       self.effects = gun.effects;\r
+       self.alpha = gun.alpha;\r
+       self.colormap = gun.colormap;\r
+       self.colormod = gun.colormod; // used by the regurgitating colors\r
+       self.glowmod = gun.glowmod;\r
 \r
        self.nextthink = time;\r
 }\r
 \r
-void W_DisplaySetup(entity own, float num, float load)\r
+void W_DisplaySetup(entity own, float num, float load, float exterior)\r
 {\r
        entity digit, e;\r
        digit = spawn();\r
        digit.owner = own;\r
        digit.weapon = own.switchweapon;\r
+       digit.team = exterior;\r
        e = get_weaponinfo(digit.weapon);\r
 \r
        if(load)\r
@@ -1633,9 +1650,15 @@ void W_Display(entity own, float load_num, float ammo_num)
 {\r
        float i;\r
        for(i = 1; i <= load_num; i += 1)\r
-               W_DisplaySetup(own, i, TRUE); // weapon load digit\r
+       {\r
+               W_DisplaySetup(own, i, TRUE, FALSE); // weapon load digit, view model\r
+               W_DisplaySetup(own, i, TRUE, TRUE); // weapon load digit, exterior model\r
+       }\r
        for(i = 1; i <= ammo_num; i += 1)\r
-               W_DisplaySetup(own, i, FALSE); // ammo count digit\r
+       {\r
+               W_DisplaySetup(own, i, FALSE, FALSE); // ammo count digit, view model\r
+               W_DisplaySetup(own, i, FALSE, TRUE); // ammo count digit, exterior model\r
+       }\r
 }\r
 \r
 void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)\r