]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
moved interpolation of viewangles when playing back demos or spectating someone to...
[xonotic/darkplaces.git] / cl_main.c
index 9380a58e2a771d4e36589906a0b5c6b038410a06..3086515dfb86f80d127afeca24e5c9375825d3c9 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -1473,6 +1473,20 @@ void CL_LerpPlayer(float frac)
                cl.punchvector[i] = cl.mpunchvector[1][i] + frac * (cl.mpunchvector[0][i] - cl.mpunchvector[1][i]);
                cl.velocity[i] = cl.mvelocity[1][i] + frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);
        }
+
+       // interpolate the angles if playing a demo or spectating someone
+       if (cls.demoplayback || cl.fixangle[0])
+       {
+               for (i = 0;i < 3;i++)
+               {
+                       float d = cl.mviewangles[0][i] - cl.mviewangles[1][i];
+                       if (d > 180)
+                               d -= 360;
+                       else if (d < -180)
+                               d += 360;
+                       cl.viewangles[i] = cl.mviewangles[1][i] + frac * d;
+               }
+       }
 }
 
 void CSQC_RelinkAllEntities (int drawmask)