From 755b0a1844bce8f240289af3870137c5e467a143 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 23 Aug 2004 05:34:04 +0000 Subject: [PATCH] now only does stair smoothing when onground (thanks to Sajt for noticing this bug) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4362 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/view.c b/view.c index cca80214..b47112d6 100644 --- 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) { -- 2.39.2