#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
-.float digit_type;\r
void W_DisplayThink()\r
{\r
// the owner has switched to another weapon, remove the digits\r
setattachment(self, self.owner.weaponentity, "tag_weapon");\r
}\r
\r
-void W_DisplaySetup(entity own, float load_num, float ammo_num)\r
+void W_DisplaySetup(entity own, float num, float load)\r
{\r
- float i;\r
- for(i = 1; i <= load_num + ammo_num; i += 1)\r
- {\r
- entity digit, e;\r
- digit = spawn();\r
- digit.owner = own;\r
- digit.weapon = own.switchweapon;\r
- digit.cnt = i;\r
- digit.movetype = MOVETYPE_FOLLOW;\r
- e = get_weaponinfo(digit.weapon);\r
+ entity digit, e;\r
+ digit = spawn();\r
+ digit.owner = own;\r
+ digit.weapon = own.switchweapon;\r
+ e = get_weaponinfo(digit.weapon);\r
\r
- if(i <= load_num)\r
- {\r
- // weapon load digit\r
- digit.digit_type = 0;\r
- setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3"));\r
- }\r
- else\r
- {\r
- // ammo count digit\r
- digit.digit_type = 1;\r
- setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3"));\r
- }\r
- digit.think = W_DisplayThink;\r
- digit.nextthink = time;\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_DisplayThink;\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
+ W_DisplaySetup(own, i, TRUE); // weapon load digit\r
+ for(i = 1; i <= ammo_num; i += 1)\r
+ W_DisplaySetup(own, i, FALSE); // ammo count digit\r
}\r
\r
void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)\r