\r
void W_DisplayDigitThink()\r
{\r
+ // dprint(strcat(ftos(gun.scale), " --------\n"));\r
+\r
self.nextthink = time;\r
float w_load, w_ammo;\r
w_load = self.owner.weapon_load[self.owner.weapon];\r
return;\r
}\r
\r
- entity gun;\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
- gun = self.owner.exteriorweaponentity;\r
- }\r
- else // view weapon\r
- {\r
- // keep the digit attached to the same bone as the gun\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;\r
- }\r
-\r
// copy all properties of the weapon 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
+ self.origin = self.weaponentity.origin;\r
+ self.angles = self.weaponentity.angles;\r
+ self.scale = self.weaponentity.scale;\r
+ self.effects = self.weaponentity.effects;\r
+ self.alpha = self.weaponentity.alpha;\r
+ self.colormap = self.weaponentity.colormap;\r
+ self.colormod = self.weaponentity.colormod; // used by the regurgitating colors\r
+ self.glowmod = self.weaponentity.glowmod;\r
\r
string txt;\r
if(self.team) // weapon load display\r
digit = spawn();\r
digit.owner = own;\r
digit.weapon = own.weapon;\r
- digit.dmg = exterior;\r
digit.team = load;\r
digit.cnt = num;\r
e = get_weaponinfo(digit.weapon);\r
\r
+ if(exterior) // exterior weapon\r
+ {\r
+ // keep the digit attached to the same bone as the gun\r
+ setattachment(digit, digit.owner, "bip01 r hand");\r
+ digit.weaponentity = digit.owner.exteriorweaponentity;\r
+ }\r
+ else // view weapon\r
+ {\r
+ // keep the digit attached to the same bone as the gun\r
+ // TODO: Does this work with self-animated weapons too?\r
+ if(gettagindex(digit.owner.weaponentity, "weapon"))\r
+ setattachment(digit, digit.owner.weaponentity, "weapon");\r
+ else if(gettagindex(digit.owner.weaponentity, "tag_weapon"))\r
+ setattachment(digit, digit.owner.weaponentity, "tag_weapon");\r
+ digit.weaponentity = digit.owner.weaponentity;\r
+ }\r
+\r
if(load)\r
{\r
// weapon load digit\r
digit.nextthink = time;\r
}\r
\r
-void W_Display(entity own, float load_num, float ammo_num)\r
+void W_Display(entity own)\r
{\r
float i;\r
- for(i = 1; i <= load_num; i++)\r
+ entity e;\r
+ e = get_weaponinfo(own.weapon);\r
+\r
+ for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3")); i++)\r
{\r
W_DisplayDigitSetup(own, i, TRUE, FALSE); // weapon load digit, view model\r
W_DisplayDigitSetup(own, i, TRUE, TRUE); // weapon load digit, exterior model\r
}\r
- for(i = 1; i <= ammo_num; i++)\r
+ for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3")); i++)\r
{\r
W_DisplayDigitSetup(own, i, FALSE, FALSE); // ammo count digit, view model\r
W_DisplayDigitSetup(own, i, FALSE, TRUE); // ammo count digit, exterior model\r