Attempt to fix characters occasionally getting launched out of the sub at lightspeed when the sub crashes into something (even if the impact doesn't appear to be that hard): impacts don't increase the velocity of the characters above 20 units/s.
This commit is contained in:
@@ -28,6 +28,16 @@ namespace Barotrauma
|
||||
MathHelper.SmoothStep(v1.Y, v2.Y, amount));
|
||||
}
|
||||
|
||||
public static Vector2 ClampLength(this Vector2 v, float length)
|
||||
{
|
||||
float currLength = v.Length();
|
||||
if (v.Length() > length)
|
||||
{
|
||||
return v / currLength * length;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
public static float Round(float value, float div)
|
||||
{
|
||||
return (value < 0.0f) ?
|
||||
|
||||
Reference in New Issue
Block a user