]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply 337eb6343 "Use crouch status instead of crouch key to indicate when player...
authorterencehill <piuntn@gmail.com>
Wed, 3 Mar 2021 13:06:46 +0000 (14:06 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 3 Mar 2021 13:06:46 +0000 (14:06 +0100)
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/server/client.qc

index 1103233e4f8250aa391a29a2b4c2aa06cd3757b4..a6611b755dabfa4026ba5a7c24446f2155934678 100644 (file)
@@ -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;
index 4e04373bd6f4ecfa0d1afb62137a4e3dd55a7536..6fc37b13ef20925da5eade301faa7366621002af 100644 (file)
@@ -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);