Fixed disappearing blocks / Unit tech tree entries

This commit is contained in:
Anuken
2022-02-07 10:58:22 -05:00
parent bf22b601f7
commit 6bbbd5ab01
11 changed files with 149 additions and 21 deletions

View File

@@ -173,6 +173,22 @@ public class Units{
return boolResult;
}
public static boolean anyEntities(float x, float y, float width, float height, Boolf<Unit> check){
boolResult = false;
nearby(x, y, width, height, unit -> {
if(boolResult) return;
if(check.get(unit)){
unit.hitboxTile(hitrect);
if(hitrect.overlaps(aeX, aeY, aeW, aeH)){
boolResult = true;
}
}
});
return boolResult;
}
/** Returns the nearest damaged tile. */
public static Building findDamagedTile(Team team, float x, float y){
return indexer.getDamaged(team).min(b -> b.dst2(x, y));