From f8a0d8acef9fb62dac0597954b4606bb767d7753 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 9 Aug 2013 05:41:16 +1000 Subject: [PATCH] Dodging while frozen requires only 1 key push --- mutators.cfg | 2 +- qcsrc/server/mutators/mutator_dodging.qc | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mutators.cfg b/mutators.cfg index b43bc006a..44739e06d 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -11,7 +11,7 @@ set g_dodging 0 "set to 1 to enable dodging in games" seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable" set sv_dodging_wall_dodging 0 "set to 1 to allow dodging off walls. 0 to disable" -set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging" +set sv_dodging_delay 0.7 "determines how long a player has to wait to be able to dodge again after dodging" set sv_dodging_up_speed 200 "the jump velocity of the dodge" set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge" set sv_dodging_horiz_speed_frozen 200 "the horizontal velocity of the dodge while frozen" diff --git a/qcsrc/server/mutators/mutator_dodging.qc b/qcsrc/server/mutators/mutator_dodging.qc index 0101b98c5..263df8225 100644 --- a/qcsrc/server/mutators/mutator_dodging.qc +++ b/qcsrc/server/mutators/mutator_dodging.qc @@ -168,6 +168,9 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { tap_direction_x = 0; tap_direction_y = 0; + + float frozen_dodging; + frozen_dodging = (self.freezetag_frozen && autocvar_sv_dodging_frozen); float dodge_detected; if (g_dodging == 0) @@ -185,7 +188,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { if (self.movement_x > 0) { // is this a state change? - if (!(self.pressedkeys & KEY_FORWARD)) { + if (!(self.pressedkeys & KEY_FORWARD) || frozen_dodging) { if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) { tap_direction_x = 1.0; dodge_detected = 1; @@ -196,7 +199,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { if (self.movement_x < 0) { // is this a state change? - if (!(self.pressedkeys & KEY_BACKWARD)) { + if (!(self.pressedkeys & KEY_BACKWARD) || frozen_dodging) { tap_direction_x = -1.0; if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; @@ -207,7 +210,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { if (self.movement_y > 0) { // is this a state change? - if (!(self.pressedkeys & KEY_RIGHT)) { + if (!(self.pressedkeys & KEY_RIGHT) || frozen_dodging) { tap_direction_y = 1.0; if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; @@ -218,7 +221,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { if (self.movement_y < 0) { // is this a state change? - if (!(self.pressedkeys & KEY_LEFT)) { + if (!(self.pressedkeys & KEY_LEFT) || frozen_dodging) { tap_direction_y = -1.0; if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; -- 2.39.2