#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
+ if(self.weapon != self.owner.weapon)\r
+ {\r
+ self.nextthink = 0;\r
+ remove(self);\r
+ self = world;\r
+ return;\r
+ }\r
+ self.nextthink = time;\r
+setattachment(self, self.owner.weaponentity.weaponentity, strcat("displaydigit_", ftos(self.cnt)));\r
+ //dprint(strcat(ftos(self.cnt), " --------\n"));\r
+}\r
+\r
+void W_DisplaySetup(entity own, float load_num, float load_scale, float ammo_num, float ammo_scale)\r
+{\r
+ float i;\r
+ for(i = 1; i <= load_num + ammo_num; i += 1)\r
+ {\r
+ entity digit;\r
+ digit = spawn();\r
+ //setmodel(digit, "models/weapons/w_displaydigit.md3");\r
+ setmodel(digit, "models/items/g_h1.md3");\r
+ digit.owner = own;\r
+ digit.weapon = own.weapon;\r
+ digit.cnt = i;\r
+\r
+ if(i <= load_num)\r
+ {\r
+ // weapon load digit\r
+ digit.digit_type = 0;\r
+ digit.scale = load_scale;\r
+ }\r
+ else\r
+ {\r
+ // ammo count digit\r
+ digit.digit_type = 1;\r
+ digit.scale = ammo_scale;\r
+ }\r
+\r
+ digit.think = W_DisplayThink;\r
+ digit.nextthink = time;\r
+ //digit.viewmodelforclient = own;\r
+ //setattachment(digit, own.weaponentity.weaponentity, "");\r
+\r
+ dprint(strcat(own.weaponentity.weaponentity.classname, " --------\n"));\r
+ }\r
+}\r
+\r
void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)\r
{\r
if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload)\r