From: havoc Date: Mon, 23 Aug 2004 05:34:04 +0000 (+0000) Subject: now only does stair smoothing when onground (thanks to Sajt for noticing this bug) X-Git-Tag: xonotic-v0.1.0preview~5715 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=755b0a1844bce8f240289af3870137c5e467a143;p=xonotic%2Fdarkplaces.git 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 --- 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) {