Fixed massive pathfinding memory usage with no valid path

This commit is contained in:
Anuken 2022-10-01 10:12:23 -04:00
parent 1a47705718
commit 8db01e6aa2

View File

@ -576,6 +576,11 @@ public class ControlPathfinder{
result.reverse();
smoothPath();
}else{
//don't keep this around in memory, better to dump entirely - using clear() keeps around massive arrays for invalid paths
frontier = new PathfindQueue();
cameFrom = new IntIntMap();
costs = new IntFloatMap();
}
done = true;