BlockIndexer null team fix

This commit is contained in:
Anuken
2021-08-19 09:37:12 -04:00
parent 41829b8660
commit 558ee579e1

View File

@@ -202,15 +202,20 @@ public class BlockIndexer{
} }
public boolean eachBlock(@Nullable Team team, float wx, float wy, float range, Boolf<Building> pred, Cons<Building> cons){ public boolean eachBlock(@Nullable Team team, float wx, float wy, float range, Boolf<Building> pred, Cons<Building> cons){
breturnArray.clear();
if(team == null){ if(team == null){
returnBool = false;
allBuildings(wx, wy, range, b -> { allBuildings(wx, wy, range, b -> {
if(pred.get(b)){ if(pred.get(b)){
breturnArray.add(b); returnBool = true;
cons.get(b);
} }
}); });
return returnBool;
}else{ }else{
breturnArray.clear();
var buildings = team.data().buildings; var buildings = team.data().buildings;
if(buildings == null) return false; if(buildings == null) return false;
buildings.intersect(wx - range, wy - range, range*2f, range*2f, b -> { buildings.intersect(wx - range, wy - range, range*2f, range*2f, b -> {