Preload naval paths on liquid spawns

This commit is contained in:
Anuken
2020-12-30 19:35:23 -05:00
parent f5410c5712
commit 727b47dba5
4 changed files with 11 additions and 6 deletions
+7 -2
View File
@@ -19,7 +19,7 @@ import mindustry.world.meta.*;
import static mindustry.Vars.*;
public class Pathfinder implements Runnable{
private static final long maxUpdate = Time.millisToNanos(6);
private static final long maxUpdate = Time.millisToNanos(7);
private static final int updateFPS = 60;
private static final int updateInterval = 1000 / updateFPS;
private static final int impassable = -1;
@@ -37,7 +37,7 @@ public class Pathfinder implements Runnable{
public static final int
costGround = 0,
costLegs = 1,
costWater = 2;
costNaval = 2;
public static final Seq<PathCost> costTypes = Seq.with(
//ground
@@ -90,6 +90,11 @@ public class Pathfinder implements Runnable{
preloadPath(getField(state.rules.waveTeam, costGround, fieldCore));
//preload water on naval maps
if(spawner.getSpawns().contains(t -> t.floor().isLiquid)){
preloadPath(getField(state.rules.waveTeam, costNaval, fieldCore));
}
start();
});