From 594d03259cd19a4abeb86f68ce9326e142bb9ea7 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 12 Dec 2014 16:13:30 +1100 Subject: [PATCH] Move client side jump calculation into CheckPlayerJump --- qcsrc/common/physics.qc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 1e6c0d171..20f1e8c0c 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -562,6 +562,23 @@ void CheckPlayerJump() else UNSET_JUMP_HELD(self); +#endif +#ifdef CSQC + // jump if on ground with jump button pressed but only if it has been + // released at least once since the last jump + if (PHYS_INPUT_BUTTON_JUMP(self)) + { + pm_multijump = FALSE; + PM_multijump_checkjump(); + if((IS_ONGROUND(self) || pm_multijump) && (!IS_JUMP_HELD(self) || !PHYS_TRACK_CANJUMP(self))) + { + self.velocity_z += PHYS_JUMPVELOCITY; + UNSET_ONGROUND(self); + SET_JUMP_HELD(self); // canjump = false + } + } + else + UNSET_JUMP_HELD(self); // canjump = true #endif if (self.waterlevel == WATERLEVEL_SWIMMING) CheckWaterJump(); @@ -1730,23 +1747,6 @@ void PM_Main() else { -#ifdef CSQC - // jump if on ground with jump button pressed but only if it has been - // released at least once since the last jump - if (PHYS_INPUT_BUTTON_JUMP(self)) - { - pm_multijump = FALSE; - PM_multijump_checkjump(); - if((IS_ONGROUND(self) || pm_multijump) && (!IS_JUMP_HELD(self) || !PHYS_TRACK_CANJUMP(self))) - { - self.velocity_z += PHYS_JUMPVELOCITY; - UNSET_ONGROUND(self); - SET_JUMP_HELD(self); // canjump = false - } - } - else - UNSET_JUMP_HELD(self); // canjump = true -#endif if (IS_ONGROUND(self)) PM_walk(buttons_prev, maxspeed_mod); else -- 2.39.2