Better AI reachable cleanup (#1507)

Haven't profiled so can't say if it definitely fixes the leak.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-07-28 00:11:07 +10:00
committed by GitHub
parent 0a82aba88e
commit 89e0925c32
2 changed files with 57 additions and 3 deletions

View File

@@ -36,6 +36,8 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
public HashSet<PathfindingNode> Nodes => _nodes;
private HashSet<PathfindingNode> _nodes;
public bool Deleted { get; private set; }
public PathfindingRegion(PathfindingNode originNode, HashSet<PathfindingNode> nodes, bool isDoor = false)
{
OriginNode = originNode;
@@ -53,6 +55,8 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
var neighbor = neighbors[i];
neighbor.Neighbors.Remove(this);
}
Deleted = true;
}
/// <summary>