From 558ee579e1d7ac7c3126c7ca7a164e4fc92f59bd Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 19 Aug 2021 09:37:12 -0400 Subject: [PATCH] BlockIndexer null team fix --- core/src/mindustry/ai/BlockIndexer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index f91aa89e11..519720e4ac 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -202,15 +202,20 @@ public class BlockIndexer{ } public boolean eachBlock(@Nullable Team team, float wx, float wy, float range, Boolf pred, Cons cons){ - breturnArray.clear(); if(team == null){ + returnBool = false; + allBuildings(wx, wy, range, b -> { if(pred.get(b)){ - breturnArray.add(b); + returnBool = true; + cons.get(b); } }); + return returnBool; }else{ + breturnArray.clear(); + var buildings = team.data().buildings; if(buildings == null) return false; buildings.intersect(wx - range, wy - range, range*2f, range*2f, b -> {