fix bug with gun bobbing in demo playback (where input packets are not sent, and...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Aug 2006 08:53:29 +0000 (08:53 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Aug 2006 08:53:29 +0000 (08:53 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6572 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
cl_parse.c
protocol.c
view.c

index 577d837..c4b05ac 100644 (file)
@@ -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)
index 40288c0..b5c8be1 100644 (file)
@@ -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;
index 40f79fb..f3882c4 100644 (file)
@@ -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 f1f66e5..02a4d34 100644 (file)
--- 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);