]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port pressedkeys to ClientState
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 18:22:47 +0000 (04:22 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 18:22:47 +0000 (04:22 +1000)
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/server/client.qc
qcsrc/server/client.qh

index 88547f7bf4c2268e3dabd7507152aa100fa9d87d..8e90ef3534f169fb3d50fc036dab17fd8fbb71fd 100644 (file)
@@ -12,7 +12,6 @@
 #define PHYS_DODGING_WALL                                      autocvar_sv_dodging_wall_dodging
 #define PHYS_DODGING_AIR                                       autocvar_sv_dodging_air_dodging
 #define PHYS_DODGING_MAXSPEED                          autocvar_sv_dodging_maxspeed
-#define PHYS_DODGING_PRESSED_KEYS(s)           (s).pressedkeys
 
 // we ran out of stats slots! TODO: re-enable this when prediction is available for dodging
 #if 0
 #ifdef CSQC
        #define PHYS_DODGING_FRAMETIME                          (1 / (frametime <= 0 ? 60 : frametime))
        #define PHYS_DODGING_TIMEOUT(s)                         STAT(DODGING_TIMEOUT)
+       #define PHYS_DODGING_PRESSED_KEYS(s)            (s).pressedkeys
 #elif defined(SVQC)
        #define PHYS_DODGING_FRAMETIME                          sys_frametime
        #define PHYS_DODGING_TIMEOUT(s)                         s.cvar_cl_dodging_timeout
+       #define PHYS_DODGING_PRESSED_KEYS(s)            CS(s).pressedkeys
 #endif
 
 #ifdef SVQC
index 7e6311df1bc7cde481ee40b3efcf54ec58e51522..808d08101b120ca18ced191749a3de141f4b29d2 100644 (file)
@@ -86,9 +86,8 @@ void multi_touch(entity this, entity toucher)
        }
 
        // if the trigger has pressed keys, check that the player is pressing those keys
-       if(this.pressedkeys)
-       if(IS_PLAYER(toucher)) // only for players
-       if(!(toucher.pressedkeys & this.pressedkeys))
+       if(this.pressedkeys && IS_PLAYER(toucher)) // only for players
+       if(!(CS(toucher).pressedkeys & this.pressedkeys))
                return;
 
        EXACTTRIGGER_TOUCH(this, toucher);
index 68f8d6a44a9a8e08c94207c93c08199d37071fec..f3da3ca0159415f171f279b13f2116e3bc661e71 100644 (file)
@@ -1682,7 +1682,7 @@ 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; // store for other users
+       CS(this).pressedkeys = keys; // store for other users
 
        STAT(PRESSED_KEYS, this) = keys;
 }
index 201cfff1a7f929b930a7a6d9be302895385b7b36..53f562d86496b6caf9d55c86f9b1f7910143f2c1 100644 (file)
@@ -73,6 +73,7 @@ CLASS(Client, Object)
     ATTRIB(Client, killindicator_teamchange, int, this.killindicator_teamchange);
     ATTRIB(Client, idlekick_lasttimeleft, float, this.idlekick_lasttimeleft);
     ATTRIB(Client, pm_frametime, float, this.pm_frametime);
+    ATTRIB(Client, pressedkeys, int, this.pressedkeys);
 
     METHOD(Client, m_unwind, bool(Client this));