From e0b3003c95d61e92e2d4ae5b8bbe185ac6b3837b Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 9 Feb 2022 17:52:02 -0500 Subject: [PATCH] Better pathfinder maxUpdate implementation for multiple teams --- core/src/mindustry/ai/Pathfinder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index b76ad3d37a..fa79849286 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -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); } }