From: divverent Date: Mon, 26 Dec 2011 15:54:33 +0000 (+0000) Subject: make CSQC support the >0.05s/<0.0005s handling of standard player physics so CSQC... X-Git-Tag: xonotic-v0.6.0~86^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=850a1f8aea8389d12f32d95ff948e255a32033ba;p=xonotic%2Fdarkplaces.git make CSQC support the >0.05s/<0.0005s handling of standard player physics so CSQC code doesn't have to git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11622 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_input.c b/cl_input.c index af5289f5..51a5f8dd 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1440,7 +1440,7 @@ static void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) } } -void CL_ClientMovement_PlayerMove(cl_clientmovement_state_t *s) +static void CL_ClientMovement_PlayerMove(cl_clientmovement_state_t *s) { //Con_Printf(" %f", frametime); if (!s->cmd.jump) @@ -1545,6 +1545,27 @@ void CL_UpdateMoveVars(void) cl.movevars_aircontrol_power = 2; // CPMA default } +void CL_ClientMovement_PlayerMove_Frame(cl_clientmovement_state_t *s) +{ + // if a move is more than 50ms, do it as two moves (matching qwsv) + //Con_Printf("%i ", s.cmd.msec); + if(s->cmd.frametime > 0.0005) + { + if (s->cmd.frametime > 0.05) + { + s->cmd.frametime /= 2; + CL_ClientMovement_PlayerMove(s); + } + CL_ClientMovement_PlayerMove(s); + } + else + { + // we REALLY need this handling to happen, even if the move is not executed + if (!s->cmd.jump) + s->cmd.canjump = true; + } +} + void CL_ClientMovement_Replay(void) { int i; @@ -1590,23 +1611,8 @@ void CL_ClientMovement_Replay(void) if (i < CL_MAX_USERCMDS - 1) s.cmd.canjump = cl.movecmd[i+1].canjump; - // if a move is more than 50ms, do it as two moves (matching qwsv) - //Con_Printf("%i ", s.cmd.msec); - if(s.cmd.frametime > 0.0005) - { - if (s.cmd.frametime > 0.05) - { - s.cmd.frametime /= 2; - CL_ClientMovement_PlayerMove(&s); - } - CL_ClientMovement_PlayerMove(&s); - } - else - { - // we REALLY need this handling to happen, even if the move is not executed - if (!s.cmd.jump) - s.cmd.canjump = true; - } + CL_ClientMovement_PlayerMove_Frame(&s); + cl.movecmd[i].canjump = s.cmd.canjump; } //Con_Printf("\n"); diff --git a/client.h b/client.h index b5fd04fa..45964700 100644 --- a/client.h +++ b/client.h @@ -1871,7 +1871,7 @@ typedef struct cl_clientmovement_state_s usercmd_t cmd; } cl_clientmovement_state_t; -void CL_ClientMovement_PlayerMove(cl_clientmovement_state_t *s); +void CL_ClientMovement_PlayerMove_Frame(cl_clientmovement_state_t *s); // warpzone prediction hack (CSQC builtin) void CL_RotateMoves(const matrix4x4_t *m); diff --git a/clvm_cmds.c b/clvm_cmds.c index 7975bf1e..a0cb9468 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1490,7 +1490,7 @@ static void VM_CL_runplayerphysics (prvm_prog_t *prog) s.cmd.jump = (s.cmd.buttons & 2) != 0; s.cmd.crouch = (s.cmd.buttons & 16) != 0; - CL_ClientMovement_PlayerMove(&s); + CL_ClientMovement_PlayerMove_Frame(&s); if(ent == prog->edicts) {