From: divverent Date: Wed, 6 May 2009 06:54:24 +0000 (+0000) Subject: cl_movement: move crouch handling so that sv_maxairspeed*0.5 is maximum crouching... X-Git-Tag: xonotic-v0.1.0preview~1670 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ee732892c6e3ca467914c77944199f479321190f;p=xonotic%2Fdarkplaces.git cl_movement: move crouch handling so that sv_maxairspeed*0.5 is maximum crouching speed, not sv_maxspeed*0.5 (matches Nexuiz) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8947 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_input.c b/cl_input.c index a9da42cc..cea4cab2 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1028,13 +1028,13 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) VectorScale(wishvel, 1 / wishspeed, wishdir); else VectorSet( wishdir, 0.0, 0.0, 0.0 ); - wishspeed = min(wishspeed, cl.movevars_maxspeed); - if (s->crouched) - wishspeed *= 0.5; - // check if onground if (s->onground) { + wishspeed = min(wishspeed, cl.movevars_maxspeed); + if (s->crouched) + wishspeed *= 0.5; + // apply edge friction f = sqrt(s->velocity[0] * s->velocity[0] + s->velocity[1] * s->velocity[1]); if (f > 0) @@ -1085,6 +1085,9 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) // apply air speed limit wishspeed = min(wishspeed, cl.movevars_maxairspeed); + if (s->crouched) + wishspeed *= 0.5; + accel = cl.movevars_airaccelerate; // CPM: air control