]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't overwrite the .pressedkeys field (abused by other things)
authorMario <mario@smbclan.net>
Sat, 8 Oct 2016 17:03:25 +0000 (03:03 +1000)
committerMario <mario@smbclan.net>
Sat, 8 Oct 2016 17:03:25 +0000 (03:03 +1000)
qcsrc/server/client.qc
qcsrc/server/defs.qh

index e42807ec5de086baf5572a1c23f3398b165b6a3d..9432b6704e217d53ba966a2fa148cb2f09b477e2 100644 (file)
@@ -1607,7 +1607,7 @@ void SetZoomState(entity this, float z)
 void GetPressedKeys(entity this)
 {
        MUTATOR_CALLHOOK(GetPressedKeys, this);
-       int keys = this.pressedkeys;
+       int keys = STAT(PRESSED_KEYS, this);
        keys = BITSET(keys, KEY_FORWARD,        this.movement.x > 0);
        keys = BITSET(keys, KEY_BACKWARD,       this.movement.x < 0);
        keys = BITSET(keys, KEY_RIGHT,          this.movement.y > 0);
@@ -1617,7 +1617,9 @@ void GetPressedKeys(entity this)
        keys = BITSET(keys, KEY_CROUCH,         PHYS_INPUT_BUTTON_CROUCH(this));
        keys = BITSET(keys, KEY_ATCK,           PHYS_INPUT_BUTTON_ATCK(this));
        keys = BITSET(keys, KEY_ATCK2,          PHYS_INPUT_BUTTON_ATCK2(this));
-       this.pressedkeys = keys;
+       this.pressedkeys = keys; // store for other users
+
+       STAT(PRESSED_KEYS, this) = keys;
 }
 
 /*
@@ -1650,7 +1652,7 @@ void SpectateCopy(entity this, entity spectatee)
        this.hit_time = spectatee.hit_time;
        this.strength_finished = spectatee.strength_finished;
        this.invincible_finished = spectatee.invincible_finished;
-       this.pressedkeys = spectatee.pressedkeys;
+       STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
        this.weapons = spectatee.weapons;
        this.vortex_charge = spectatee.vortex_charge;
        this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
index b034968901e741e40d348952fdf7ef40ab16f9d9..9c3e7bba02148e52f34a75556c054f9affe12457 100644 (file)
@@ -261,7 +261,7 @@ bool independent_players;
 
 string clientstuff;
 .float phase;
-.int pressedkeys = _STAT(PRESSED_KEYS);
+.int pressedkeys;
 
 .string fog;