From fa92c7ed3e39a10967c85d2436963923993f8605 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 27 Apr 2022 14:18:53 -0400 Subject: [PATCH] Fixed crash --- core/src/mindustry/entities/comp/BuildingComp.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 828137e91b..6c97239273 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -272,11 +272,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, if(!ignoreConditions && (!block.rebuildable || (team == state.rules.defaultTeam && state.isCampaign() && !block.isVisible()))) return; Object overrideConfig = null; + Block toAdd = this.block; if(self() instanceof ConstructBuild entity){ //update block to reflect the fact that something was being constructed if(entity.current != null && entity.current.synthetic() && entity.wasConstructing){ - block = entity.current; + toAdd = entity.current; overrideConfig = entity.lastConfig; }else{ //otherwise this was a deconstruction that was interrupted, don't want to rebuild that @@ -298,7 +299,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } } - data.blocks.addFirst(new BlockPlan(tile.x, tile.y, (short)rotation, block.id, overrideConfig == null ? config() : overrideConfig)); + data.blocks.addFirst(new BlockPlan(tile.x, tile.y, (short)rotation, toAdd.id, overrideConfig == null ? config() : overrideConfig)); } public @Nullable Tile findClosestEdge(Position to, Boolf solid){