Fix randomWaveAI causing units to target untargetable blocks (#10870)

* Update Pathfinder.java

* Update FlyingAI.java
This commit is contained in:
Sh1p*nfire
2025-06-02 01:49:03 +10:00
committed by GitHub
parent 44b25d6e64
commit 6c29460ade
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;