From d51d01c3e844232b6c26719cf725dbd2e1f46182 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 6 Aug 2018 11:43:46 +0300 Subject: [PATCH] Fixed Submarine.HandleLimbCollision attempting to set the velocity of the sub to an invalid value when the current velocity is extremely small --- Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs b/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs index 22d147ad4..89de82b74 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs @@ -505,7 +505,7 @@ namespace Barotrauma avgContactNormal /= levelContacts.Count; float contactDot = Vector2.Dot(Body.LinearVelocity, -avgContactNormal); - if (contactDot > 0.0f) + if (contactDot > 0.001f) { Vector2 velChange = Vector2.Normalize(Body.LinearVelocity) * contactDot; if (!MathUtils.IsValid(velChange))