]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_dodging.qc
Merge branch 'master' into terencehill/ca_fixes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_dodging.qc
index 6e187b90c4c765fdcc109be419e82e62de60513e..b26fe1b9fff657fa13c38d35689ee689153d7c51 100644 (file)
@@ -169,8 +169,9 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
        tap_direction_x = 0;
        tap_direction_y = 0;
 
-       float frozen_dodging;
+       float frozen_dodging, frozen_no_doubletap;
        frozen_dodging = (self.frozen && autocvar_sv_dodging_frozen);
+       frozen_no_doubletap = (frozen_dodging && !autocvar_sv_dodging_frozen_doubletap);
 
        float dodge_detected;
        if (g_dodging == 0)
@@ -188,7 +189,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_x > 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_FORWARD) || frozen_dodging) {
+               if (!(self.pressedkeys & KEY_FORWARD) || frozen_no_doubletap) {
                        if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) {
                                tap_direction_x = 1.0;
                                dodge_detected = 1;
@@ -199,7 +200,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_x < 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_BACKWARD) || frozen_dodging) {
+               if (!(self.pressedkeys & KEY_BACKWARD) || frozen_no_doubletap) {
                        tap_direction_x = -1.0;
                        if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout)        {
                                dodge_detected = 1;
@@ -210,7 +211,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_y > 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_RIGHT) || frozen_dodging) {
+               if (!(self.pressedkeys & KEY_RIGHT) || frozen_no_doubletap) {
                        tap_direction_y = 1.0;
                        if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout)   {
                                dodge_detected = 1;
@@ -221,7 +222,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_y < 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_LEFT) || frozen_dodging) {
+               if (!(self.pressedkeys & KEY_LEFT) || frozen_no_doubletap) {
                        tap_direction_y = -1.0;
                        if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout)    {
                                dodge_detected = 1;