};\r
\r
// Bringed back weapon frame\r
+.float display_setup;\r
void W_WeaponFrame()\r
{\r
vector fo, ri, up;\r
+ entity e;\r
\r
if (frametime)\r
self.weapon_frametime = frametime;\r
ri = v_right;\r
up = v_up;\r
\r
+ if(!self.display_setup)\r
+ {\r
+ if(self.weaponentity.modelindex && self.exteriorweaponentity.modelindex)\r
+ {\r
+ float i;\r
+ e = get_weaponinfo(self.weapon);\r
+\r
+ for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3")); i++)\r
+ {\r
+ W_DisplayDigitSetup(self, i, TRUE, FALSE); // weapon load digit, view model\r
+ W_DisplayDigitSetup(self, i, TRUE, TRUE); // weapon load digit, exterior model\r
+ }\r
+ for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3")); i++)\r
+ {\r
+ W_DisplayDigitSetup(self, i, FALSE, FALSE); // ammo count digit, view model\r
+ W_DisplayDigitSetup(self, i, FALSE, TRUE); // ammo count digit, exterior model\r
+ }\r
+\r
+ self.display_setup = TRUE;\r
+ }\r
+ }\r
+ else if(self.weapon != self.switchweapon || self.classname != "player" || self.deadflag != DEAD_NO)\r
+ self.display_setup = FALSE;\r
+\r
// Change weapon\r
if (self.weapon != self.switchweapon)\r
{\r
self.weaponentity.state = WS_RAISE;\r
weapon_action(self.switchweapon, WR_SETUP);\r
\r
- W_Display(self);\r
-\r
// set our clip load to the load of the weapon we switched to, if it's reloadable\r
- entity e;\r
e = get_weaponinfo(self.switchweapon);\r
if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) // prevent accessing undefined cvars\r
{\r
digit.nextthink = time;\r
}\r
\r
-void W_Display(entity own)\r
-{\r
- float 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; 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
- }\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