From c3c88a434f23dd5b2cab5428dca759af37f29b35 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 2 Apr 2021 07:56:24 -0400 Subject: [PATCH] CScriptBallTrigger: Fix force calculation --- Runtime/World/CScriptBallTrigger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/World/CScriptBallTrigger.cpp b/Runtime/World/CScriptBallTrigger.cpp index a07ac78a9..beb10f4f4 100644 --- a/Runtime/World/CScriptBallTrigger.cpp +++ b/Runtime/World/CScriptBallTrigger.cpp @@ -66,7 +66,7 @@ void CScriptBallTrigger::Think(float dt, CStateManager& mgr) { } else { const zeus::CVector3f offset = radiusPosDif.normalized(); if (std::cos(zeus::degToRad(x154_minAngle)) < (-offset).dot(x15c_forceAngle) && distance < x158_maxDistance) { - const float force = zeus::min((1.f / dt * distance), x150_force * (distance * distance)); + const float force = zeus::min((1.f / dt * distance), x150_force * (x158_maxDistance / (distance * distance))); player.ApplyForceWR(force * (player.GetMass() * offset), zeus::CAxisAngle()); } }