diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index 8dd4a378364d..711c65a9ab0b 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -193,7 +193,7 @@ public boolean getPathPosition(Unit unit, int pathId, Vec2 destination, Vec2 out } //destination is impassable, can't go there. - if(solid(team, costType, world.packArray(World.toTile(destination.x), World.toTile(destination.y)))){ + if(solid(team, costType, world.packArray(World.toTile(destination.x), World.toTile(destination.y)), false)){ return false; } @@ -380,7 +380,7 @@ private static boolean permissiveRaycast(int team, PathCost type, int x1, int y1 int err = dx - dy; while(x >= 0 && y >= 0 && x < ww && y < wh){ - if(solid(team, type, x + y * wwidth)) return true; + if(solid(team, type, x + y * wwidth, true)) return true; if(x == x2 && y == y2) return false; //no diagonals @@ -429,9 +429,9 @@ private static boolean avoid(int team, PathCost type, int tilePos){ return cost == impassable || cost >= 2; } - private static boolean solid(int team, PathCost type, int tilePos){ + private static boolean solid(int team, PathCost type, int tilePos, boolean checkWall){ int cost = cost(team, type, tilePos); - return cost == impassable || cost >= 6000; + return cost == impassable || (checkWall && cost >= 6000); } private static float tileCost(int team, PathCost type, int a, int b){