]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 577d837389c850b2e5e72b6401d398b38a3a5eef..c4b05acc0ef6fcc0361b248c2b01b5486a8fcbc9 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 40288c0919215a295d852bb1c57d30e8a98a0674..b5c8be165070646be70d3790c65b0f5944ce5c95 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 40f79fb9c03d404704524ddbe5de836d89c62c16..f3882c4f275fa30898ea3a9240bf11c379c70680 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 f1f66e550216f46e1a648764f65a5a9d622540d1..02a4d34c85e30f307ab365baf4c09bdd10b24c4f 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);