float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
float WR_SWITCHABLE = 12; // (CSQC) impact effect
float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
+float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
float HUD_PANEL_WEAPONS = 0;
float HUD_PANEL_AMMO = 1;
W_SwitchWeapon_Force(self, w_getbestweapon(self));
wb = 0;
}
+
+ v_forward = fo;
+ v_right = ri;
+ v_up = up;
+
if(wb)
- {
- v_forward = fo;
- v_right = ri;
- v_up = up;
weapon_action(self.weapon, WR_THINK);
- }
+ else
+ weapon_action(self.weapon, WR_GONETHINK);
+
if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
{
if(self.weapon_think)
if(self.hagar_load)
{
// if we pressed primary fire while loading, unload all rockets and abort
+ self.weaponentity.state = WS_READY;
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
self.hagar_load = 0;
sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
if(!self.hagar_loadblock && self.hagar_loadstep < time)
{
W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
+ self.weaponentity.state = WS_INUSE;
self.hagar_load += 1;
sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);
if(self.hagar_load)
{
- self.weaponentity.state = WS_INUSE; // prevents weapon switching
if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
+ {
+ self.weaponentity.state = WS_READY;
W_Hagar_Attack2_Load_Release();
+ }
}
else
{
- self.weaponentity.state = WS_READY; // allows weapon switching
self.hagar_loadbeep = FALSE;
}
}
}
}
+ else if (req == WR_GONETHINK)
+ {
+ // we lost the weapon and want to prepare switching away
+ if(self.hagar_load)
+ {
+ self.weaponentity.state = WS_READY;
+ W_Hagar_Attack2_Load_Release();
+ }
+ }
else if (req == WR_PRECACHE)
{
precache_model ("models/weapons/g_hagar.md3");