Fix randomWaveAI causing units to target untargetable blocks (#10870)
* Update Pathfinder.java * Update FlyingAI.java
This commit is contained in:
@@ -540,7 +540,7 @@ public class Pathfinder implements Runnable{
|
||||
if(!targets.isEmpty()){
|
||||
boolean any = false;
|
||||
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) && other.block.targetable){
|
||||
out.add(other.tile.array());
|
||||
any = true;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FlyingAI extends AIController{
|
||||
Building closest = null;
|
||||
float cdist = 0f;
|
||||
for(Building t : list){
|
||||
if((t.items != null && t.items.any()) || t.status() != BlockStatus.noInput){
|
||||
if(((t.items != null && t.items.any()) || t.status() != BlockStatus.noInput) && t.block.targetable){
|
||||
float dst = t.dst2(x, y);
|
||||
if(closest == null || dst < cdist){
|
||||
closest = t;
|
||||
|
||||
Reference in New Issue
Block a user