mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-06 08:57:45 +07:00
Cleanup
This commit is contained in:
parent
12bcc050a6
commit
320b2ae54d
@ -1275,19 +1275,8 @@ public class HierarchyPathFinder implements Runnable{
|
||||
}
|
||||
|
||||
private void clusterChanged(int team, int pathCost, int cx, int cy){
|
||||
//TODO very important: invalidate paths!
|
||||
//reset all flowfields that contain this cluster
|
||||
//remove all paths that contain this cluster
|
||||
//VERY important: don't replace all the data.
|
||||
|
||||
int index = cx + cy * cwidth;
|
||||
|
||||
//TODO go through each path request:
|
||||
// - if it contains this cluster in its field:
|
||||
// - DONE mark for it to be recomputed next frame in a Set (so it doesn't happen twice!)
|
||||
// - DONE recomputing should invalidate the flowfield
|
||||
// - recomputing should save the old flowfield Somewhere
|
||||
// - DONE invalidations should be batched every few seconds (let's say, 2)
|
||||
for(var req : threadPathRequests){
|
||||
var field = fields.get(req.destination);
|
||||
if((field != null && field.fields.containsKey(index)) || req.notFound){
|
||||
|
Loading…
Reference in New Issue
Block a user