From b63501b1c7cea96146b6664ba66b3f748bb71ddd Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 28 Nov 2020 21:51:26 -0500 Subject: [PATCH] Core overfill bugfix --- core/src/mindustry/world/blocks/ConstructBlock.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index e895018273..c99f36f36b 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -19,6 +19,7 @@ import mindustry.graphics.*; import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.storage.CoreBlock.*; import mindustry.world.modules.*; import static mindustry.Vars.*; @@ -275,7 +276,7 @@ public class ConstructBlock extends Block{ if(clampedAmount > 0 && accumulated > 0){ //if it's positive, add it to the core if(core != null && requirements[i].item.unlockedNow()){ //only accept items that are unlocked - int accepting = core.acceptStack(requirements[i].item, accumulated, builder); + int accepting = Math.min(accumulated, ((CoreBuild)core).storageCapacity - core.items.get(requirements[i].item)); //transfer items directly, as this is not production. core.items.add(requirements[i].item, accepting); accumulator[i] -= accepting;