From: havoc Date: Sun, 27 Aug 2006 08:53:29 +0000 (+0000) Subject: fix bug with gun bobbing in demo playback (where input packets are not sent, and... X-Git-Tag: xonotic-v0.1.0preview~3814 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=ab694c7041cf18f029bfce7e37c0d121b0f8d0c1 fix bug with gun bobbing in demo playback (where input packets are not sent, and thus the prediction replay was not occurring...) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6572 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_input.c b/cl_input.c index 577d8373..c4b05acc 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1110,6 +1110,7 @@ void CL_ClientMovement_Replay(void) VectorCopy(cl.mvelocity[0], s.velocity); s.crouched = true; // will be updated on first move s.canjump = cl.movement_replay_canjump; + //Con_Printf("movement replay starting org %f %f %f vel %f %f %f\n", s.origin[0], s.origin[1], s.origin[2], s.velocity[0], s.velocity[1], s.velocity[2]); // set up movement variables if (cls.protocol == PROTOCOL_QUAKEWORLD) diff --git a/cl_parse.c b/cl_parse.c index 40288c09..b5c8be16 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1411,6 +1411,9 @@ void CL_ParseClientdata (void) // viewzoom interpolation cl.mviewzoom[0] = (float) max(cl.stats[STAT_VIEWZOOM], 2) * (1.0f / 255.0f); + + // force a recalculation of the player prediction + cl.movement_replay = true; } /* @@ -2208,6 +2211,9 @@ void CL_ParseServerMessage(void) if (!cls.demoplayback) VectorCopy(cl.mviewangles[0], cl.mviewangles[1]); + // force a recalculation of the player prediction + cl.movement_replay = true; + // slightly kill qw player entities each frame for (i = 1;i < cl.maxclients;i++) cl.entities_active[i] = false; diff --git a/protocol.c b/protocol.c index 40f79fb9..f3882c4f 100644 --- a/protocol.c +++ b/protocol.c @@ -2470,6 +2470,9 @@ void EntityStateQW_ReadPlayerUpdate(void) // if this is an update on our player, update interpolation state if (enumber == cl.playerentity) { + // force a recalculation of the player prediction + cl.movement_replay = true; + VectorCopy (cl.mpunchangle[0], cl.mpunchangle[1]); VectorCopy (cl.mpunchvector[0], cl.mpunchvector[1]); VectorCopy (cl.mvelocity[0], cl.mvelocity[1]); diff --git a/view.c b/view.c index f1f66e55..02a4d34c 100644 --- a/view.c +++ b/view.c @@ -364,7 +364,7 @@ void V_CalcRefdef (void) VectorCopy(cl.viewangles, viewangles); // update the stairoffset if the player entity has gone up or down without leaving the ground - //Con_Printf("cl.onground %i oldz %f newz %f\n", cl.onground, oldz, vieworg[2]); + //Con_Printf("cl.onground %i oldz %f newz %f vel %f %f %f\n", cl.onground, oldz, vieworg[2], cl.movement_velocity[0], cl.movement_velocity[1], cl.movement_velocity[2]); cl.stairoffset -= vieworg[2] - oldz; oldz = vieworg[2]; cl.stairoffset = bound(-16, cl.stairoffset, 16);