From 11638cbb216d7ce7fc160a4bf92a86829fd44e77 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Tue, 6 Aug 2024 03:54:56 +0700 Subject: [PATCH] Fixed a bug in spectator move with no apply friction when stopped --- regamedll/pm_shared/pm_shared.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 544d8fba..8bd88587 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -1711,20 +1711,24 @@ void PM_SpectatorMove() currentspeed = DotProduct(pmove->velocity, wishdir); addspeed = wishspeed - currentspeed; + +#ifdef REGAMEDLL_FIXES if (addspeed <= 0) - { return; - } - - accelspeed = pmove->movevars->accelerate * pmove->frametime * wishspeed; - if (accelspeed > addspeed) +#else + if (addspeed > 0) +#endif { - accelspeed = addspeed; - } + accelspeed = pmove->movevars->accelerate * pmove->frametime * wishspeed; + if (accelspeed > addspeed) + { + accelspeed = addspeed; + } - for (i = 0; i < 3; i++) - { - pmove->velocity[i] += accelspeed * wishdir[i]; + for (i = 0; i < 3; i++) + { + pmove->velocity[i] += accelspeed * wishdir[i]; + } } // move