X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=b4c13851bf47514c57a0212e5d2df0e0a4bcc627;hp=5912261dbf68cf6bca6a47ce8e86db480c2cd2b9;hb=c2afbf519433fb56c9b8b807ca3ab12c62575ec8;hpb=16e64ff58cf65d7b3e0815aadb530580a6aa251b diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 5912261db..b4c13851b 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -266,6 +266,7 @@ void W_SwitchToOtherWeapon(entity this, .entity weaponentity) 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) @@ -281,7 +282,7 @@ bool W_SwitchWeapon(entity this, Weapon w, .entity weaponentity) return false; } } - else if(!forbidWeaponUse(this)) + else if(!forbidWeaponUse(this) && autocvar_cl_weapon_switch_reload) { entity actor = this; w.wr_reload(w, actor, weaponentity); @@ -290,9 +291,10 @@ bool W_SwitchWeapon(entity this, Weapon w, .entity 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)) + if(!W_SwitchWeapon(this, w, weaponentity) && autocvar_cl_weapon_switch_fallback_to_impulse) W_NextWeaponOnImpulse(this, w.impulse, weaponentity); }