mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-31 18:04:21 +07:00
Minor AI fix
This commit is contained in:
parent
a15a0d945f
commit
f0027a3eff
@ -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 --;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user