From 71c083787c72015967511ca12569c3145e16c988 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 3 Mar 2021 14:06:46 +0100 Subject: [PATCH] Apply 337eb6343 "Use crouch status instead of crouch key to indicate when player is crouching in pressed keys code" to PM_dodging_GetPressedKeys too --- qcsrc/common/mutators/mutator/dodging/sv_dodging.qc | 3 ++- qcsrc/server/client.qc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc index 1103233e4..a6611b755 100644 --- a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc @@ -280,6 +280,7 @@ void PM_dodging_GetPressedKeys(entity this) { PM_dodging_checkpressedkeys(this); + // NOTE: GetPressedKeys and PM_dodging_GetPressedKeys use similar code int keys = this.pressedkeys; keys = BITSET(keys, KEY_FORWARD, PHYS_CS(this).movement.x > 0); keys = BITSET(keys, KEY_BACKWARD, PHYS_CS(this).movement.x < 0); @@ -287,7 +288,7 @@ void PM_dodging_GetPressedKeys(entity this) keys = BITSET(keys, KEY_LEFT, PHYS_CS(this).movement.y < 0); keys = BITSET(keys, KEY_JUMP, PHYS_INPUT_BUTTON_JUMP(this)); - keys = BITSET(keys, KEY_CROUCH, PHYS_INPUT_BUTTON_CROUCH(this)); + keys = BITSET(keys, KEY_CROUCH, IS_DUCKED(this)); // workaround: player can't un-crouch until their path is clear, so we keep the button held here keys = BITSET(keys, KEY_ATCK, PHYS_INPUT_BUTTON_ATCK(this)); keys = BITSET(keys, KEY_ATCK2, PHYS_INPUT_BUTTON_ATCK2(this)); this.pressedkeys = keys; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 4e04373bd..6fc37b13e 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1715,6 +1715,7 @@ void GetPressedKeys(entity this) return; } + // NOTE: GetPressedKeys and PM_dodging_GetPressedKeys use similar code int keys = STAT(PRESSED_KEYS, this); keys = BITSET(keys, KEY_FORWARD, CS(this).movement.x > 0); keys = BITSET(keys, KEY_BACKWARD, CS(this).movement.x < 0); -- 2.39.2