From: Mario Date: Sat, 8 Oct 2016 17:03:25 +0000 (+1000) Subject: Don't overwrite the .pressedkeys field (abused by other things) X-Git-Tag: xonotic-v0.8.2~534 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d3586818a0126eec5771fa3e8c19827f9745d416;p=xonotic%2Fxonotic-data.pk3dir.git Don't overwrite the .pressedkeys field (abused by other things) --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index e42807ec5..9432b6704 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index b03496890..9c3e7bba0 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -261,7 +261,7 @@ bool independent_players; string clientstuff; .float phase; -.int pressedkeys = _STAT(PRESSED_KEYS); +.int pressedkeys; .string fog;