// Also updates the keys before firing, so we don't have to switch to another weapon and back to apply the changes
set preattack_last 0
set preattack2_last 0
-alias +preattack "firing_swap2 $firing_lastweapon; set preattack_last 1; +checkattack"
-alias -preattack "firing_swap2 $firing_lastweapon; set preattack_last 0; -checkattack"
-alias +preattack2 "firing_swap2 $firing_lastweapon; set preattack2_last 1; +checkattack2"
-alias -preattack2 "firing_swap2 $firing_lastweapon; set preattack2_last 0; -checkattack2"
+alias +preattack "firing_swap_apply $firing_lastweapon; set preattack_last 1; +checkattack"
+alias -preattack "set preattack_last 0; -checkattack"
+alias +preattack2 "firing_swap_apply $firing_lastweapon; set preattack2_last 1; +checkattack2"
+alias -preattack2 "set preattack2_last 0; -checkattack2"
alias firing_switch_attack_0 ""
alias firing_switch_attack2_0 ""
alias firing_switch_attack_1 "+preattack"
// now apply changes to the key binds and get the weapon we are using
alias firing_decision_0 "alias +checkattack +attack; alias -checkattack -attack; alias +checkattack2 +attack2; alias -checkattack2 -attack2"
alias firing_decision_1 "alias +checkattack +attack2; alias -checkattack -attack2; alias +checkattack2 +attack; alias -checkattack2 -attack"
-alias firing_swap2 "firing_decision_${$1}"
-alias firing_swap "firing_swap2 cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch"
+alias firing_swap_apply "firing_decision_${$1}"
+alias firing_swap "firing_swap_apply cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch"
// this hook activates when we switch weapons, and allows us to script weapon specific properties (like the fire button swapping script)
alias cl_hook_activeweapon "firing_swap $1"