]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port buttons_old to ClientState
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 18:54:51 +0000 (04:54 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 18:54:51 +0000 (04:54 +1000)
qcsrc/common/physics/player.qh
qcsrc/ecs/systems/physics.qc
qcsrc/ecs/systems/sv_physics.qc
qcsrc/server/client.qh

index a9fbde9b0b50541103ef66f3e8bd9af7f7f52a98..e3e563ebeda615c245ff67055fcc11603d6f5599 100644 (file)
@@ -18,7 +18,6 @@
 #endif
 
 .vector movement_old;
-.float buttons_old;
 .vector v_angle_old;
 .string lastclassname;
 
index f4fa0e609177eb49bfee6fe96760ae574f2196f7..8a324281abb101f1eda605ff6f047204ce766d8a 100644 (file)
@@ -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;
 
index ed3d3eaa8ae66d5089a7ee5a15f03758401f3ed6..1a69c75fc9a4ce45eed864caa15e8da243756ce4 100644 (file)
@@ -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)
index fa1529818c6ebf0ad1116142b303daa83c2b422c..4178ca9e6edba768fcd9dd4145b3e73759dcc246 100644 (file)
@@ -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));