- if(cl.movevars_maxairstrafespeed)
- {
- if(wishspeed > cl.movevars_maxairstrafespeed)
- wishspeed = cl.movevars_maxairstrafespeed;
- if(cl.movevars_maxairstrafespeed < cl.movevars_maxairspeed)
- accelqw = 1;
- // otherwise, CPMA-style air acceleration misbehaves a lot
- // if partially non-QW acceleration is used (as in, strafing
- // would get faster than moving forward straight)
- }
- if(cl.movevars_airstrafeaccelerate)
- {
- accel = cl.movevars_airstrafeaccelerate;
- if(cl.movevars_airstrafeaccelerate > cl.movevars_airaccelerate)
- accelqw = 1;
- // otherwise, CPMA-style air acceleration misbehaves a lot
- // if partially non-QW acceleration is used (as in, strafing
- // would get faster than moving forward straight)
- }
+ 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));