From 1db79a33dac8f04378e22ee8cf90170884c4f136 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 2 Jul 2010 14:28:31 +0300 Subject: [PATCH] Fix an issue introduced with separating the script --- script_swapattacks.cfg | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/script_swapattacks.cfg b/script_swapattacks.cfg index 4a676a7fb9..5457c364c3 100644 --- a/script_swapattacks.cfg +++ b/script_swapattacks.cfg @@ -1,4 +1,5 @@ -// this script allows swapping the primary and secondary fire buttons for any weapon, using the cl_swapattacks_* cvars. +// 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 fire_last 0 @@ -12,8 +13,15 @@ alias firing_switch_attack2_0 "" 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" alias firing_swap_apply "firing_decision_${$1}" -alias firing_swap "firing_swap_apply cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch" \ No newline at end of file +alias firing_swap "firing_swap_apply cl_swapattacks_$1; set firing_lastweapon cl_swapattacks_$1; firing_switch" + +// not correct, but prevents firing from braking after executing the script until switching weapons +alias +fire +attack +alias -fire -attack +alias +fire2 +attack2 +alias -fire2 -attack2 \ No newline at end of file -- 2.39.2