Fixed Submarine.HandleLimbCollision attempting to set the velocity of the sub to an invalid value when the current velocity is extremely small

This commit is contained in:
Joonas Rikkonen
2018-08-06 11:43:46 +03:00
parent 9052782a6c
commit d51d01c3e8

View File

@@ -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))