From: Mario Date: Mon, 17 Jul 2017 21:30:24 +0000 (+1000) Subject: Port v_angle_old to ClientState X-Git-Tag: xonotic-v0.8.5~2576 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7fb2f5dfe9863e899728e5428e919fa4ea0466ba;p=xonotic%2Fxonotic-data.pk3dir.git Port v_angle_old to ClientState --- diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index a77a03b58..23456ebbe 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -22,6 +22,7 @@ .float spectatorspeed; #endif +.int buttons_old; .vector movement_old; .vector v_angle_old; .string lastclassname; diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index 8a324281a..ba38407f3 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -18,7 +18,8 @@ void sys_phys_update(entity this, float dt) if (sys_phys_override(this, dt)) { return; } sys_phys_monitor(this, dt); PHYS_CS(this).movement_old = PHYS_CS(this).movement; - this.v_angle_old = this.v_angle; + PHYS_CS(this).v_angle_old = this.v_angle; + PHYS_CS(this).buttons_old = PHYS_INPUT_BUTTON_MASK(this); sys_phys_ai(this); diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index 87982b5d5..c20ae8bda 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -24,12 +24,10 @@ void sys_phys_monitor(entity this, float dt) if (sv_maxidle > 0) { 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; } + || this.v_angle != CS(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 d5552dacd..e2445aa3e 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -99,6 +99,7 @@ CLASS(Client, Object) ATTRIB(Client, latency_sum, float, this.latency_sum); ATTRIB(Client, latency_cnt, int, this.latency_cnt); ATTRIB(Client, latency_time, float, this.latency_time); + ATTRIB(Client, v_angle_old, vector, this.v_angle_old); METHOD(Client, m_unwind, bool(Client this));