From 310fa880a5e60afafd68fd127a445e9356e52dae Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 4 Dec 2026 16:09:56 +0100 Subject: [PATCH] Cap vertical deflection above 65 m/s^2 to downward arrest only (prevent ramp sky launch) --- src/RustToDust.Ymir/ArenaSession.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/RustToDust.Ymir/ArenaSession.cs b/src/RustToDust.Ymir/ArenaSession.cs index ff89857..2209032 100644 --- a/src/RustToDust.Ymir/ArenaSession.cs +++ b/src/RustToDust.Ymir/ArenaSession.cs @@ -672,14 +672,21 @@ namespace RustToDust.Ymir } // Steep-slope velocity projection / deflection: when contacting terrain and moving into the surface, - // damp inward normal velocity cleanly (capped at cancelling vn to 0 so it never adds upward launch velocity). + // damp inward normal velocity cleanly while never converting horizontal speed into an upward sky launch. if (maxPen > 0f) { float vn = Vector3.Dot(vel, terrainNormal); if (vn < 0f) { float deflectMag = MathF.Min(-vn * mass * 42f, -vn * mass / FixedDt); - supportForce += terrainNormal * deflectMag; + Vector3 deflectForce = terrainNormal * deflectMag; + // Allow vertical deflection above 65 m/s^2 ONLY to arrest actual downward velocity (vel.Y < 0). + float maxDeflectY = MathF.Max(0f, maxSpringY - supportForce.Y) + MathF.Max(0f, (-vel.Y * mass) / FixedDt); + if (deflectForce.Y > maxDeflectY) + { + deflectForce.Y = maxDeflectY; + } + supportForce += deflectForce; } } }