Minor AI fix
This commit is contained in:
@@ -470,12 +470,16 @@ public class Pathfinder implements Runnable{
|
|||||||
for(int attempt = 0; attempt < 5 && max > 0; attempt++){
|
for(int attempt = 0; attempt < 5 && max > 0; attempt++){
|
||||||
var targets = indexer.getEnemy(team, randomTargets[rand.random(randomTargets.length - 1)]);
|
var targets = indexer.getEnemy(team, randomTargets[rand.random(randomTargets.length - 1)]);
|
||||||
if(!targets.isEmpty()){
|
if(!targets.isEmpty()){
|
||||||
max --;
|
boolean any = false;
|
||||||
for(Building other : targets){
|
for(Building other : targets){
|
||||||
if((other.items != null && other.items.any()) || other.status() != BlockStatus.noInput){
|
if((other.items != null && other.items.any()) || other.status() != BlockStatus.noInput){
|
||||||
out.add(other.tile.array());
|
out.add(other.tile.array());
|
||||||
|
any = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(any){
|
||||||
|
max --;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user