From 4289a8238c7c37bccbe7c33fa797f2c2cdbaa3ab Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 3 Jul 2009 08:48:29 +0000 Subject: [PATCH] CPMA physics: force airaccelqw=1 when strafing if using CPMA-style modded strafe acceleration (otherwise, it can be used as a weird movement exploit) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9039 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_input.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cl_input.c b/cl_input.c index 4920784e..4688041e 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1196,9 +1196,10 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) if (s->waterjumptime <= 0) { // apply air speed limit - vec_t accel, wishspeed2; + vec_t accel, wishspeed2, accelqw; qboolean accelerating; + accelqw = cl.movevars_airaccel_qw; wishspeed = min(wishspeed, cl.movevars_maxairspeed); if (s->crouched) wishspeed *= 0.5; @@ -1217,14 +1218,21 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) if(wishspeed > cl.movevars_maxairstrafespeed) wishspeed = cl.movevars_maxairstrafespeed; 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) + } } // !CPM if(cl.movevars_warsowbunny_turnaccel && accelerating && s->cmd.sidemove == 0 && s->cmd.forwardmove != 0) CL_ClientMovement_Physics_PM_AirAccelerate(s, wishdir, wishspeed2); else - CL_ClientMovement_Physics_PM_Accelerate(s, wishdir, wishspeed, accel, cl.movevars_airaccel_qw, cl.movevars_airaccel_sideways_friction / cl.movevars_maxairspeed); + CL_ClientMovement_Physics_PM_Accelerate(s, wishdir, wishspeed, accel, accelqw, cl.movevars_airaccel_sideways_friction / cl.movevars_maxairspeed); if(cl.movevars_aircontrol) CL_ClientMovement_Physics_CPM_PM_Aircontrol(s, wishdir, wishspeed2); -- 2.39.2