From: Mario Date: Fri, 12 Dec 2014 05:13:30 +0000 (+1100) Subject: Move client side jump calculation into CheckPlayerJump X-Git-Tag: xonotic-v0.8.1~38^2~67 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=594d03259cd19a4abeb86f68ce9326e142bb9ea7;p=xonotic%2Fxonotic-data.pk3dir.git Move client side jump calculation into CheckPlayerJump --- 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