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{