Fixed a "sequence contains no elements" exception in IndoorsSteeringManager
This commit is contained in:
@@ -109,9 +109,9 @@ namespace Barotrauma
|
|||||||
if (currentPath.Finished)
|
if (currentPath.Finished)
|
||||||
{
|
{
|
||||||
Vector2 pos2 = host.SimPosition;
|
Vector2 pos2 = host.SimPosition;
|
||||||
if (character != null && character.Submarine == null && CurrentPath.Nodes.Last().Submarine != null)
|
if (character != null && character.Submarine == null &&
|
||||||
|
CurrentPath.Nodes.Count > 0 && CurrentPath.Nodes.Last().Submarine != null)
|
||||||
{
|
{
|
||||||
//todo: take multiple subs into account
|
|
||||||
pos2 -= CurrentPath.Nodes.Last().Submarine.SimPosition;
|
pos2 -= CurrentPath.Nodes.Last().Submarine.SimPosition;
|
||||||
}
|
}
|
||||||
return currentTarget - pos2;
|
return currentTarget - pos2;
|
||||||
|
|||||||
Reference in New Issue
Block a user