bind 9 "impulse 9"
bind 0 "impulse 14" // cycles the superweapons
bind q weaplast
-bind MOUSE1 +preattack
-bind MOUSE2 +preattack2
+bind MOUSE1 +fire
+bind MOUSE2 +fire2
bind MOUSE3 +zoom
bind MOUSE4 weaplast
bind MOUSE5 +hook
bind JOY2 "+jump"
bind JOY3 "weapprev"
bind JOY4 "weapnext"
-bind JOY5 "+preattack2"
-bind JOY6 "+preattack"
+bind JOY5 "+fire2"
+bind JOY6 "+fire"
bind JOY7 "+zoom"
bind JOY8 "dropweapon"
bind JOY9 "menu_showteamselect"
// this script allows swapping the primary and secondary fire buttons for any weapon, using the cl_swapattacks_* cvars.
// This part of the code is necessary to keep us firing when we switch weapons while holding a fire button pressed.
// 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_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"
+set fire_last 0
+set fire2_last 0
+alias +fire "firing_swap_apply $firing_lastweapon; set fire_last 1; +checkattack"
+alias -fire "set fire_last 0; -checkattack"
+alias +fire2 "firing_swap_apply $firing_lastweapon; set fire2_last 1; +checkattack2"
+alias -fire2 "set fire2_last 0; -checkattack2"
alias firing_switch_attack_0 ""
alias firing_switch_attack2_0 ""
-alias firing_switch_attack_1 "+preattack"
-alias firing_switch_attack2_1 "+preattack2"
-alias firing_switch "-preattack; -preattack2; firing_switch_attack_$preattack_last; firing_switch_attack2_$preattack2_last;"
+alias firing_switch_attack_1 "+fire"
+alias firing_switch_attack2_1 "+fire2"
+alias firing_switch "-fire; -fire2; firing_switch_attack_$fire_last; firing_switch_attack2_$fire2_last;"
// 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"