This commit is contained in:
Anuken
2019-12-29 21:45:59 -05:00
parent 689b0b8c61
commit ee4f06a9c2
6 changed files with 39 additions and 23 deletions

View File

@@ -83,13 +83,7 @@ public class Units{
public static TileEntity findEnemyTile(Team team, float x, float y, float range, Boolf<Tile> pred){
if(team == Team.derelict) return null;
for(Team enemy : team.enemies()){
TileEntity entity = indexer.findTile(enemy, x, y, range, pred, true);
if(entity != null){
return entity;
}
}
return null;
return indexer.findEnemyTile(team, x, y, range, pred);
}
/** Returns the closest target enemy. First, units are checked, then tile entities. */