W_SwitchWeapon_Force(this, ww, weaponentity);
}
-AUTOCVAR_SAVE(cl_weapon_switch_reload, bool, true, "When trying to switch to the currently held weapon, reload it");
bool W_SwitchWeapon(entity this, Weapon w, .entity weaponentity)
{
if(this.(weaponentity).m_switchweapon != w)
return false;
}
}
- else if(!forbidWeaponUse(this) && autocvar_cl_weapon_switch_reload)
+ else if(!forbidWeaponUse(this) && CS(this).cvar_cl_weapon_switch_reload)
{
entity actor = this;
w.wr_reload(w, actor, weaponentity);
return true; // player already has the weapon out or needs to reload
}
-AUTOCVAR_SAVE(cl_weapon_switch_fallback_to_impulse, bool, true, "When trying to switch to a weapon that is not available, switch to an alternative from the same impulse");
void W_SwitchWeapon_TryOthers(entity this, Weapon w, .entity weaponentity)
{
- if(!W_SwitchWeapon(this, w, weaponentity) && autocvar_cl_weapon_switch_fallback_to_impulse)
+ if(!W_SwitchWeapon(this, w, weaponentity) && CS(this).cvar_cl_weapon_switch_fallback_to_impulse)
W_NextWeaponOnImpulse(this, w.impulse, weaponentity);
}