]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cl_movement: move crouch handling so that sv_maxairspeed*0.5 is maximum crouching...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 6 May 2009 06:54:24 +0000 (06:54 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 6 May 2009 06:54:24 +0000 (06:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8947 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c

index a9da42ccf43cbc494461347617dbf084c3e82e96..cea4cab2002e8cbad23b180438a7da1f3b9e6f54 100644 (file)
@@ -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