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:
@@ -505,7 +505,7 @@ namespace Barotrauma
|
|||||||
avgContactNormal /= levelContacts.Count;
|
avgContactNormal /= levelContacts.Count;
|
||||||
|
|
||||||
float contactDot = Vector2.Dot(Body.LinearVelocity, -avgContactNormal);
|
float contactDot = Vector2.Dot(Body.LinearVelocity, -avgContactNormal);
|
||||||
if (contactDot > 0.0f)
|
if (contactDot > 0.001f)
|
||||||
{
|
{
|
||||||
Vector2 velChange = Vector2.Normalize(Body.LinearVelocity) * contactDot;
|
Vector2 velChange = Vector2.Normalize(Body.LinearVelocity) * contactDot;
|
||||||
if (!MathUtils.IsValid(velChange))
|
if (!MathUtils.IsValid(velChange))
|
||||||
|
|||||||
Reference in New Issue
Block a user