From: Rudolf Polzer Date: Tue, 20 Dec 2011 16:49:13 +0000 (+0100) Subject: try fixing issues with length of move X-Git-Tag: xonotic-v0.6.0~74^2~93 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ba904cc5e8654bc263b398375505ecd2db78f64;p=xonotic%2Fxonotic-data.pk3dir.git try fixing issues with length of move --- diff --git a/qcsrc/csqcmodel/cl_player.qc b/qcsrc/csqcmodel/cl_player.qc index 4a7cf2e10..c2e366c9d 100644 --- a/qcsrc/csqcmodel/cl_player.qc +++ b/qcsrc/csqcmodel/cl_player.qc @@ -25,6 +25,7 @@ var float autocvar_cl_predictionerrorcompensation = 0; // engine stuff .float pmove_flags; float pmove_onground; // weird engine flag we shouldn't really use but have to for now +#define PMF_JUMP_HELD 1 #define PMF_DUCKED 4 #define PMF_ONGROUND 8 #define REFDEFFLAG_TELEPORTED 1 @@ -111,8 +112,27 @@ void CSQCPlayer_PredictTo(float endframe) { break; } - runstandardplayerphysics(self); - CSQCPlayer_SetMinsMaxs(); + if(input_timelength <= 0.0005) // too short move + { + dprint("CSQC physics hack: too short frame skipped\n"); + // even if not running physics, handle releasing the jump key + if(!(input_buttons & 4)) + self.pmove_flags &~= PMF_JUMP_HELD; + } + else if(input_timelength > 0.05) // too long move + { + dprint("CSQC physics hack: too long frame split in two\n"); + input_timelength *= 0.5; + runstandardplayerphysics(self); + CSQCPlayer_SetMinsMaxs(); + runstandardplayerphysics(self); + CSQCPlayer_SetMinsMaxs(); + } + else + { + runstandardplayerphysics(self); + CSQCPlayer_SetMinsMaxs(); + } csqcplayer_moveframe++; }