From 750ac90fa29efb54e4d86beed69bc23e4a6d53a7 Mon Sep 17 00:00:00 2001 From: Jaredl-Dev <260281143+Jaredl-Dev@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:05:32 -0700 Subject: [PATCH] Fix low-acceleration movement at 60Hz --- .../Source/GameLogic/Object/Update/PhysicsUpdate.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp index 55812a5298e..ce591cd4f83 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp @@ -669,8 +669,17 @@ UpdateSleepTime PhysicsBehavior::update() // when vel gets tiny, just clamp to zero const Real THRESH = 0.001f; +#if defined(GENERALS_ONLINE_HIGH_FPS_SERVER) + // Info: At 60Hz, motive acceleration can be smaller than THRESH and must accumulate across frames. + if (!isMotive()) + { + if (fabsf(m_vel.x) < THRESH) m_vel.x = 0.0f; + if (fabsf(m_vel.y) < THRESH) m_vel.y = 0.0f; + } +#else if (fabsf(m_vel.x) < THRESH) m_vel.x = 0.0f; if (fabsf(m_vel.y) < THRESH) m_vel.y = 0.0f; +#endif if (fabsf(m_vel.z) < THRESH) m_vel.z = 0.0f; m_velMag = INVALID_VEL_MAG;