diff --git a/Subsurface/Source/Characters/AI/PathFinder.cs b/Subsurface/Source/Characters/AI/PathFinder.cs index 7ddef2f11..78846b22c 100644 --- a/Subsurface/Source/Characters/AI/PathFinder.cs +++ b/Subsurface/Source/Characters/AI/PathFinder.cs @@ -61,6 +61,7 @@ namespace Barotrauma } var nodeList = nodes.Values.ToList(); + nodeList.RemoveAll(n => n.connections.Count == 0); foreach (PathNode node in nodeList) { node.distances = new List(); @@ -69,6 +70,7 @@ namespace Barotrauma node.distances.Add(Vector2.Distance(node.position, node.connections[i].position)); } } + return nodeList; } } @@ -198,12 +200,6 @@ namespace Barotrauma { Vector2 nodePos = node.Position; - //if node waypoint is one of submarine waypoints outside the sub, transform position - //if (node.Waypoint!=null && node.Waypoint.Submarine != null && node.Waypoint.CurrentHull==null) - //{ - // nodePos -= node.Waypoint.Submarine.Position; - //} - float dist = Vector2.Distance(end, nodePos); if (dist < closestDist || endNode == null) { diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs index c10a905fa..c9250a5cc 100644 --- a/Subsurface/Source/Items/Components/Machines/Steering.cs +++ b/Subsurface/Source/Items/Components/Machines/Steering.cs @@ -424,10 +424,10 @@ namespace Barotrauma.Items.Components maintainPosTickBox.Selected = false; posToMaintain = null; + tickBox.Selected = true; UpdatePath(); - tickBox.Selected = true; return true; }