From: Lyberta Date: Sat, 19 May 2018 10:32:54 +0000 (+0300) Subject: Added dedicated sprint button. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e9795eb32f3e37852a0d1567ebd1e4d6e09f0129;p=xonotic%2Fxonotic-data.pk3dir.git Added dedicated sprint button. --- diff --git a/qcsrc/common/mutators/mutator/sprint/sv_sprint.qc b/qcsrc/common/mutators/mutator/sprint/sv_sprint.qc index bd6899e87..55d3bc5e1 100644 --- a/qcsrc/common/mutators/mutator/sprint/sv_sprint.qc +++ b/qcsrc/common/mutators/mutator/sprint/sv_sprint.qc @@ -38,7 +38,7 @@ MUTATOR_HOOKFUNCTION(sprint, SetStartItems) MUTATOR_HOOKFUNCTION(sprint, GetPressedKeys) { entity player = M_ARGV(0, entity); - if (PHYS_INPUT_BUTTON_DODGE(player)) + if (PHYS_INPUT_BUTTON_SPRINT(player)) { player.m_is_sprinting = true; } diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index da48fa698..ebaea7ddb 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -109,10 +109,14 @@ bool IsFlying(entity a); #define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s) PHYS_INPUT_BUTTON_BUTTON9(s) #define PHYS_INPUT_BUTTON_JETPACK(s) PHYS_INPUT_BUTTON_BUTTON10(s) #define PHYS_INPUT_BUTTON_DODGE(s) PHYS_INPUT_BUTTON_BUTTON11(s) +#define PHYS_INPUT_BUTTON_SPRINT(s) PHYS_INPUT_BUTTON_BUTTON12(s) #ifdef CSQC STATIC_INIT(PHYS_INPUT_BUTTON) { + localcmd("alias +sprint +button12\n"); + localcmd("alias -sprint -button12\n"); + localcmd("alias +hook +button6\n"); localcmd("alias -hook -button6\n"); diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index cde80d693..9544cff94 100644 --- a/qcsrc/menu/xonotic/keybinder.qc +++ b/qcsrc/menu/xonotic/keybinder.qc @@ -33,6 +33,7 @@ void Xonotic_KeyBinds_Read() KEYBIND_DEF("+moveright" , _("strafe right")); KEYBIND_DEF("+jump" , _("jump / swim")); KEYBIND_DEF("+crouch" , _("crouch / sink")); + KEYBIND_DEF("+sprint" , _("sprint")); KEYBIND_DEF("+hook" , _("off-hand hook")); KEYBIND_DEF("+jetpack" , _("jet pack")); KEYBIND_DEF("" , "");