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
{\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