Pathfinder tweaks (#12848)

This commit is contained in:
metalgearsloth
2022-12-07 10:33:44 +11:00
committed by GitHub
parent 8f641137e8
commit dd384c55a0
7 changed files with 18 additions and 17 deletions

View File

@@ -82,10 +82,11 @@ public sealed partial class PathfindingSystem
// Actual pathfinding here
(_, currentNode) = request.Frontier.Take();
// TODO: Need this at some stage but need to fix some steering bugs first before it's useable.
if (currentNode.Equals(endNode))// ||
//(endNode.GraphUid == currentNode.GraphUid &&
//(endNode.Box.Center - currentNode.Box.Center).Length < request.Range))
// If we're inside the required distance OR we're at the end node.
if ((request.Distance > 0f &&
currentNode.Coordinates.TryDistance(EntityManager, request.End, out var distance) &&
distance <= request.Distance) ||
currentNode.Equals(endNode))
{
arrived = true;
break;