diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index e59aa6707b..b9c039b231 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -24,6 +24,7 @@ import static mindustry.ai.Pathfinder.*; public class ControlPathfinder implements Runnable{ private static final int wallImpassableCap = 1_000_000; private static final int solidCap = 7000; + private static boolean initialized; public static boolean showDebug; @@ -213,7 +214,11 @@ public class ControlPathfinder implements Runnable{ LongSeq[][] portalConnections = new LongSeq[4][]; } - static{ + //this method is not run in a static initializer because it must only happen after Pathfinder registers its events, which means it should happen in the ControlPathfinder constructor + static void checkEvents(){ + if(initialized) return; + initialized = true; + Events.on(ResetEvent.class, event -> controlPath.stop()); Events.on(WorldLoadEvent.class, event -> { @@ -331,6 +336,10 @@ public class ControlPathfinder implements Runnable{ } } + public ControlPathfinder(){ + checkEvents(); + } + public void updateTile(Tile tile){ tile.getLinkedTiles(this::updateSingleTile); } @@ -477,6 +486,11 @@ public class ControlPathfinder implements Runnable{ //share portals with the other cluster portals = cluster.portals[direction] = other.portals[(direction + 2) % 4]; + //apparently this is somehow possible...? + if(portals == null){ + portals = cluster.portals[direction] = other.portals[(direction + 2) % 4] = new IntSeq(); + } + //clear the portals, they're being recalculated now portals.clear(); } @@ -1490,7 +1504,7 @@ public class ControlPathfinder implements Runnable{ long lastInvalidCheck = Time.millis() + invalidateCheckInterval; while(true){ - if(net.client()) return; + if(net.client() || invalidated) return; try{ if(state.isPlaying()){ queue.run(); @@ -1577,6 +1591,7 @@ public class ControlPathfinder implements Runnable{ if(!invalidated){ Log.err(e); }else{ + //This pathfinder is done, don't bother doing any tasks return; } } diff --git a/core/src/mindustry/ai/RtsAI.java b/core/src/mindustry/ai/RtsAI.java index 1fb8e6209e..95d861430d 100644 --- a/core/src/mindustry/ai/RtsAI.java +++ b/core/src/mindustry/ai/RtsAI.java @@ -28,7 +28,7 @@ public class RtsAI{ static final Seq squad = new Seq<>(false), stack = new Seq<>(); static final IntSet used = new IntSet(); static final IntSet assignedTargets = new IntSet(), invalidTarget = new IntSet(); - static final float squadRadius = 50f; + static final float squadRadius = 60f; static final int timeUpdate = 0, timerSpawn = 1, maxTargetsChecked = 15; //in order of priority?? diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 70029f0cd4..7389880756 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -508,7 +508,7 @@ public class NetServer implements ApplicationListener{ data.stream = new ByteArrayInputStream(stream.toByteArray()); player.con.sendStream(data); - debug("Packed @ bytes of world data.", stream.size()); + debug("Packed @ bytes of world data to @ (@ / @)", stream.size(), player.name, player.con.address, player.uuid()); } public void addPacketHandler(String type, Cons2 handler){ diff --git a/core/src/mindustry/graphics/Shaders.java b/core/src/mindustry/graphics/Shaders.java index 39cd5b4192..6351b64873 100644 --- a/core/src/mindustry/graphics/Shaders.java +++ b/core/src/mindustry/graphics/Shaders.java @@ -1,6 +1,7 @@ package mindustry.graphics; import arc.*; +import arc.assets.loaders.TextureLoader.*; import arc.files.*; import arc.graphics.*; import arc.graphics.Texture.*; @@ -302,11 +303,12 @@ public class Shaders{ public SpaceShader(String frag){ super(frag); - Core.assets.load("sprites/space.png", Texture.class).loaded = t -> { - texture = t; - texture.setFilter(TextureFilter.linear); - texture.setWrap(TextureWrap.mirroredRepeat); - }; + Core.assets.load("sprites/space.png", Texture.class, new TextureParameter(){{ + magFilter = TextureFilter.linear; + minFilter = TextureFilter.mipMapLinearLinear; + wrapU = wrapV = TextureWrap.mirroredRepeat; + genMipMaps = true; + }}).loaded = t -> texture = t; } @Override diff --git a/gradle.properties b/gradle.properties index 5d78e8e2af..f3a62ec065 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,4 @@ org.gradle.caching=true org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 android.enableR8.fullMode=false -archash=12e519832d +archash=23264f9514