From: Mario Date: Sat, 15 Jul 2017 18:54:51 +0000 (+1000) Subject: Port buttons_old to ClientState X-Git-Tag: xonotic-v0.8.5~2622 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=836bf45aa198f1bb7a4a0fa8bba2ac800d7bd5e9;p=xonotic%2Fxonotic-data.pk3dir.git Port buttons_old to ClientState --- diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index a9fbde9b0..e3e563ebe 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -18,7 +18,6 @@ #endif .vector movement_old; -.float buttons_old; .vector v_angle_old; .string lastclassname; diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index f4fa0e609..8a324281a 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -17,7 +17,6 @@ void sys_phys_update(entity this, float dt) sys_phys_fix(this, dt); if (sys_phys_override(this, dt)) { return; } sys_phys_monitor(this, dt); - this.buttons_old = PHYS_INPUT_BUTTON_MASK(this); PHYS_CS(this).movement_old = PHYS_CS(this).movement; this.v_angle_old = this.v_angle; diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index ed3d3eaa8..1a69c75fc 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -24,12 +24,14 @@ void sys_phys_monitor(entity this, float dt) int buttons = PHYS_INPUT_BUTTON_MASK(this); anticheat_physics(this); if (sv_maxidle > 0) { - if (buttons != this.buttons_old + if (buttons != CS(this).buttons_old || CS(this).movement != CS(this).movement_old || this.v_angle != this.v_angle_old) { CS(this).parm_idlesince = time; } } PM_check_nickspam(this); PM_check_punch(this, dt); + + CS(this).buttons_old = PHYS_INPUT_BUTTON_MASK(this); } void sys_phys_ai(entity this) diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index fa1529818..4178ca9e6 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -75,6 +75,7 @@ CLASS(Client, Object) ATTRIB(Client, pm_frametime, float, this.pm_frametime); ATTRIB(Client, pressedkeys, int, this.pressedkeys); ATTRIB(Client, movement_old, vector, this.movement_old); + ATTRIB(Client, buttons_old, int, this.buttons_old); METHOD(Client, m_unwind, bool(Client this));