void W_SwitchWeapon_Force(entity e, float w)
{
- // don't switch to another weapon if we're not allowed to
- if(e.weapon_forbidchange)
- return;
-
e.cnt = e.switchweapon;
e.switchweapon = w;
e.selectweapon = w;
(time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
) // prevent insane sound spam
{
- sound(ent, CH_ITEMS, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ sound(ent, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
ent.prevstrengthsound = time;
}
ent.prevstrengthsoundattempt = time;
void w_clear()
{
if (self.weapon != -1)
+ {
self.weapon = 0;
+ self.switchingweapon = 0;
+ }
if (self.weaponentity)
{
self.weaponentity.state = WS_CLEAR;
// the two weapon entities will notice this has changed and update their models
self.weapon = windex;
+ self.switchingweapon = windex; // to make sure
self.weaponname = e.mdl;
self.bulletcounter = 0;
};