Preload naval paths on liquid spawns
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user