From 43cac0bd1e3019f1baa905b6db906a11d05c5420 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 15 Jun 2022 08:10:06 -0400 Subject: [PATCH] Fixed #7022 --- core/src/mindustry/ai/BlockIndexer.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 32a67a0838..8bb8d66678 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -476,12 +476,15 @@ public class BlockIndexer{ notifyBuildDamaged(tile.build); } - if(!tile.block().isStatic()){ - blocksPresent[tile.floorID()] = true; - blocksPresent[tile.overlayID()] = true; + if(blocksPresent != null){ + if(!tile.block().isStatic()){ + blocksPresent[tile.floorID()] = true; + blocksPresent[tile.overlayID()] = true; + } + //bounds checks only needed in very specific scenarios + if(tile.blockID() < blocksPresent.length) blocksPresent[tile.blockID()] = true; } - //bounds checks only needed in very specific scenarios - if(tile.blockID() < blocksPresent.length) blocksPresent[tile.blockID()] = true; + } static class TurretQuadtree extends QuadTree{