targetUnderBlocks for units (#8160)

* targetUnderBlocks for units

You know, why don't units use the same targeting code as turrets?

* prioritize non-under blocks
This commit is contained in:
MEEPofFaith
2024-02-03 09:17:07 -08:00
committed by GitHub
parent dc4f3ba972
commit 75ae76135f
5 changed files with 17 additions and 4 deletions

View File

@@ -227,7 +227,7 @@ public class AIController implements UnitController{
}
public Teamc target(float x, float y, float range, boolean air, boolean ground){
return Units.closestTarget(unit.team, x, y, range, u -> u.checkTarget(air, ground), t -> ground);
return Units.closestTarget(unit.team, x, y, range, u -> u.checkTarget(air, ground), t -> ground && (unit.type.targetUnderBlocks || !t.block.underBullets));
}
public boolean retarget(){