]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix issues with weapon switching while keeping the fire button pressed, when switchin...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 1 Jul 2010 00:06:21 +0000 (03:06 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 1 Jul 2010 00:06:21 +0000 (03:06 +0300)
defaultXonotic.cfg
keybinds.txt

index e1e2eb76ed9b9ed3adc4321b4de5068a27c07be0..6dedf5bf2416ece08eaf8e22247311c8da64826c 100644 (file)
@@ -1531,10 +1531,23 @@ alias _gl_flashblend_update_11 "gl_flashblend 0"
 alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_showsurfaces"
 
 // this script allows swapping the primary and secondary fire buttons for each weapon, using the cl_swapattacks_* cvars
-alias firing_decision_0 "alias +preattack +attack; alias -preattack -attack; alias +preattack2 +attack2; alias -preattack2 -attack2"
-alias firing_decision_1 "alias +preattack +attack2; alias -preattack -attack2; alias +preattack2 +attack; alias -preattack2 -attack"
+
+set preattack_last 0
+set preattack2_last 0
+alias +preattack "set preattack_last 1; +checkattack"
+alias -preattack "set preattack_last 0; -checkattack"
+alias +preattack2 "set preattack2_last 1; +checkattack2"
+alias -preattack2 "set preattack2_last 0; -checkattack2"
+alias firing_switch_atck_0 ""
+alias firing_switch_atck2_0 ""
+alias firing_switch_atck_1 "+preattack"
+alias firing_switch_atck2_1 "+preattack2"
+alias firing_switch "-preattack; -preattack2; firing_switch_atck_$preattack_last; firing_switch_atck2_$preattack2_last;"
+
+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; -attack; -attack2"
+alias firing_swap "firing_swap2 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"
index eb4c12f54e55007fc6394be8d0b8785d7c693ff9..d4c35123aeddf0f3c2c5a5c66b34cf4a94981b20 100644 (file)
@@ -8,8 +8,8 @@
 "+hook"                                 "off-hand hook / jet pack"
 ""                                      ""
 ""                                      "Attacking"
-"+preattack"                               "primary fire"
-"+preattack2"                              "secondary fire"
+"+preattack"                            "primary fire"
+"+preattack2"                           "secondary fire"
 ""                                      ""
 ""                                      "Weapon switching"
 "weapprev"                              "previous"