]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
now only does stair smoothing when onground (thanks to Sajt for noticing this bug)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Aug 2004 05:34:04 +0000 (05:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Aug 2004 05:34:04 +0000 (05:34 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4362 d7cf8633-e32d-0410-b094-e92efae38249

view.c

diff --git a/view.c b/view.c
index cca802147246dbe6142b54d779f39a6215849745..b47112d6fa3eb69f09c683bea9c75cee066d06a2 100644 (file)
--- a/view.c
+++ b/view.c
@@ -313,7 +313,7 @@ void V_CalcRefdef (void)
 {
        static float oldz;
        entity_t *ent;
-       float vieworg[3], viewangles[3], newz;
+       float vieworg[3], viewangles[3];
        Matrix4x4_CreateIdentity(&viewmodelmatrix);
        Matrix4x4_CreateIdentity(&r_refdef.viewentitymatrix);
        if (cls.state == ca_connected && cls.signon == SIGNONS)
@@ -334,12 +334,13 @@ void V_CalcRefdef (void)
                        VectorCopy(cl.viewangles, viewangles);
 
                        // stair smoothing
-                       newz = vieworg[2];
-                       oldz -= newz;
-                       oldz += (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
-                       oldz = bound(-16, oldz, 0);
-                       vieworg[2] += oldz;
-                       oldz += newz;
+                       if (cl.onground && oldz < vieworg[2])
+                       {
+                               oldz += (cl.time - cl.oldtime) * cl_stairsmoothspeed.value;
+                               oldz = vieworg[2] = bound(vieworg[2] - 16, oldz, vieworg[2]);
+                       }
+                       else
+                               oldz = vieworg[2];
 
                        if (chase_active.value)
                        {