diff --git a/core/assets-raw/sprites/blocks/turrets/hail.png b/core/assets-raw/sprites/blocks/turrets/hail.png index 10001df6ed..aa7a70ac87 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/hail.png and b/core/assets-raw/sprites/blocks/turrets/hail.png differ diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index 7cbfc5eb19..c369f0d986 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -54,7 +54,10 @@ public class ControlPathfinder{ (PathTile.nearSolid(tile) || PathTile.solid(tile) ? 3 : 0), costNaval = (team, tile) -> - (PathTile.solid(tile) || !PathTile.liquid(tile) ? impassable : 1) + + //impassable same-team neutral block, or non-liquid + ((PathTile.solid(tile) && ((PathTile.team(tile) == team && !PathTile.teamPassable(tile)) || PathTile.team(tile) == 0)) || !PathTile.liquid(tile) ? impassable : 1) + + //impassable synthetic enemy block + ((PathTile.team(tile) != team && PathTile.team(tile) != 0) && PathTile.solid(tile) ? wallImpassableCap : 0) + (PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 6 : 0); public static boolean showDebug = false; diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index bffb9031da..ff8bb71534 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -58,7 +58,8 @@ public class Pathfinder implements Runnable{ //water (team, tile) -> - (PathTile.solid(tile) || !PathTile.liquid(tile) ? 6000 : 1) + + (!PathTile.liquid(tile) ? 6000 : 1) + + PathTile.health(tile) * 5 + (PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) + (PathTile.deep(tile) ? 0 : 1) + (PathTile.damages(tile) ? 35 : 0) @@ -527,7 +528,9 @@ public class Pathfinder implements Runnable{ } protected boolean passable(int pos){ - return cost.getCost(team.id, pathfinder.tiles[pos]) != impassable; + int amount = cost.getCost(team.id, pathfinder.tiles[pos]); + //edge case: naval reports costs of 6000+ for non-liquids, even though they are not technically passable + return amount != impassable && !(cost == costTypes.get(costNaval) && amount >= 6000); } /** Gets targets to pathfind towards. This must run on the main thread. */