Reduce finished path memory usage

This commit is contained in:
Anuken
2022-10-01 11:35:35 -04:00
parent 8db01e6aa2
commit 8752dbb978

View File

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