Checking if the position is valid in Ragdoll.FindHull
This commit is contained in:
@@ -744,7 +744,15 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void FindHull(Vector2? worldPosition = null, bool setSubmarine = true)
|
public void FindHull(Vector2? worldPosition = null, bool setSubmarine = true)
|
||||||
{
|
{
|
||||||
Vector2 findPos = worldPosition==null ? this.WorldPosition : (Vector2)worldPosition;
|
Vector2 findPos = worldPosition == null ? this.WorldPosition : (Vector2)worldPosition;
|
||||||
|
if (!MathUtils.IsValid(findPos))
|
||||||
|
{
|
||||||
|
GameAnalyticsManager.AddErrorEventOnce(
|
||||||
|
"Ragdoll.FindHull:InvalidPosition",
|
||||||
|
GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
|
||||||
|
"Attempted to find a hull at an invalid position (" + findPos + ")\n" + Environment.StackTrace);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Hull newHull = Hull.FindHull(findPos, currentHull);
|
Hull newHull = Hull.FindHull(findPos, currentHull);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user