Better pathfinder maxUpdate implementation for multiple teams

This commit is contained in:
Anuken
2022-02-09 17:52:02 -05:00
parent 3e0b8e9431
commit e0b3003c95

View File

@@ -20,7 +20,7 @@ import mindustry.world.meta.*;
import static mindustry.Vars.*;
public class Pathfinder implements Runnable{
private static final long maxUpdate = Time.millisToNanos(7);
private static final long maxUpdate = Time.millisToNanos(5);
private static final int updateFPS = 60;
private static final int updateInterval = 1000 / updateFPS;
@@ -202,9 +202,9 @@ public class Pathfinder implements Runnable{
if(state.isPlaying()){
queue.run();
//total update time no longer than maxUpdate
//each update time (not total!) no longer than maxUpdate
for(Flowfield data : threadList){
updateFrontier(data, maxUpdate / threadList.size);
updateFrontier(data, maxUpdate);
}
}