From b80c8762cc33141519f9c3a5d24106df8fb0c7fd Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 30 Nov 2024 23:59:29 -0500 Subject: [PATCH] Pathfinding cleanup --- core/src/mindustry/entities/units/AIController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/units/AIController.java b/core/src/mindustry/entities/units/AIController.java index 8adea77edb..b86b986b13 100644 --- a/core/src/mindustry/entities/units/AIController.java +++ b/core/src/mindustry/entities/units/AIController.java @@ -4,7 +4,6 @@ import arc.math.*; import arc.math.geom.*; import arc.util.*; import mindustry.*; -import mindustry.ai.*; import mindustry.entities.*; import mindustry.game.*; import mindustry.gen.*; @@ -127,7 +126,7 @@ public class AIController implements UnitController{ if(tile == null) return; Tile targetTile = pathfinder.getTargetTile(tile, pathfinder.getField(unit.team, costType, pathTarget)); - if(tile == targetTile || (costType == Pathfinder.costNaval && !targetTile.floor().isLiquid)) return; + if(tile == targetTile || !unit.canPass(targetTile.x, targetTile.y)) return; unit.movePref(vec.trns(unit.angleTo(targetTile.worldx(), targetTile.worldy()), prefSpeed())); }