diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index a18364e8f5..c6a2ed0528 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -470,12 +470,16 @@ public class Pathfinder implements Runnable{ for(int attempt = 0; attempt < 5 && max > 0; attempt++){ var targets = indexer.getEnemy(team, randomTargets[rand.random(randomTargets.length - 1)]); if(!targets.isEmpty()){ - max --; + boolean any = false; for(Building other : targets){ if((other.items != null && other.items.any()) || other.status() != BlockStatus.noInput){ out.add(other.tile.array()); + any = true; } } + if(any){ + max --; + } } } }