BlockIndexer null team fix
This commit is contained in:
@@ -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 -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user