#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"))\r
#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"))\r
\r
-void W_DisplayThink()\r
+void W_DisplayDigitThink()\r
{\r
// the owner has switched to another weapon, remove the digits\r
- if(self.weapon != self.owner.weapon)\r
+ if(self.weapon != self.owner.switchweapon)\r
{\r
self.nextthink = 0;\r
remove(self);\r
}\r
\r
entity gun;\r
- if(self.team) // exterior weapon model\r
+ if(self.team) // exterior weapon\r
{\r
- // keep the digit attached to the same bone as the weapon model\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\r
+ else // view weapon\r
{\r
- // keep the digit attached to the same bone as the weapon model\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
gun = self.owner.weaponentity.weaponentity;\r
}\r
\r
- // copy all properties of the weapon model to the digit\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.nextthink = time;\r
}\r
\r
-void W_DisplaySetup(entity own, float num, float load, float exterior)\r
+void W_DisplayDigitSetup(entity own, float num, float load, float exterior)\r
{\r
entity digit, e;\r
digit = spawn();\r
digit.cnt = 1;\r
setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(num) , ".md3"));\r
}\r
- digit.think = W_DisplayThink;\r
+ digit.think = W_DisplayDigitThink;\r
digit.nextthink = time;\r
}\r
\r
void W_Display(entity own, float load_num, float ammo_num)\r
{\r
float i;\r
- for(i = 1; i <= load_num; i += 1)\r
+ for(i = 1; i <= load_num; i++)\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
+ 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 += 1)\r
+ for(i = 1; i <= ammo_num; i++)\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
+ W_DisplayDigitSetup(own, i, FALSE, FALSE); // ammo count digit, view model\r
+ W_DisplayDigitSetup(own, i, FALSE, TRUE); // ammo count digit, exterior model\r
}\r
}\r
\r