]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make airstopaccelerate less accidentally epic ;)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Jul 2010 17:54:56 +0000 (17:54 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Jul 2010 17:54:56 +0000 (17:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10356 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c

index bc8a459727b7b9789ac033902dcbda3f38a407cd..d4ab8a01d5bf556a4b7ac01a73a0aa5bd7967753 100644 (file)
@@ -1399,8 +1399,14 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s)
 
                        // CPM: air control
                        if(cl.movevars_airstopaccelerate != 0)
-                               if(DotProduct(s->velocity, wishdir) < 0)
-                                       accel = cl.movevars_airstopaccelerate;
+                       {
+                               vec3_t curdir;
+                               curdir[0] = s->velocity[0];
+                               curdir[1] = s->velocity[1];
+                               curdir[2] = 0;
+                               VectorNormalize(curdir);
+                               accel = accel + (cl.movevars_airstopaccelerate - accel) * max(0, -DotProduct(curdir, wishdir));
+                       }
                        strafity = CL_IsMoveInDirection(s->cmd.forwardmove, s->cmd.sidemove, -90) + CL_IsMoveInDirection(s->cmd.forwardmove, s->cmd.sidemove, +90); // if one is nonzero, other is always zero
                        if(cl.movevars_maxairstrafespeed)
                                wishspeed = min(wishspeed, CL_GeomLerp(cl.movevars_maxairspeed, strafity, cl.movevars_maxairstrafespeed));