From 5ba7e1d08b8611d0eb5a40c5144dabe17f56f965 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 15 Sep 2019 16:54:58 -0400 Subject: [PATCH] fixed #665 --- .../anuke/mindustry/world/blocks/storage/CoreBlock.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java b/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java index d09edf82ab..5cafa70f57 100644 --- a/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/storage/CoreBlock.java @@ -86,21 +86,22 @@ public class CoreBlock extends StorageBlock{ } state.teams.get(tile.getTeam()).cores.add(tile); - entity.storageCapacity = entity.proximity().sum(e -> isContainer(e) ? e.block().itemCapacity : 0); + entity.storageCapacity = itemCapacity + entity.proximity().sum(e -> isContainer(e) ? e.block().itemCapacity : 0); entity.proximity().each(this::isContainer, t -> { t.entity.items = entity.items; t.entity().linkedCore = tile; }); - for(Tile other : state.teams.get(tile.getTeam()).cores){ - entity.storageCapacity += other.block().itemCapacity; + for(Tile other : state.teams.get(tile.getTeam()).cores){ + if(other == tile) continue; + entity.storageCapacity += other.block().itemCapacity + other.entity.proximity().sum(e -> isContainer(e) ? e.block().itemCapacity : 0); } for(Item item : content.items()){ entity.items.set(item, Math.min(entity.items.get(item), entity.storageCapacity)); } - for(Tile other : state.teams.get(tile.getTeam()).cores){ + for(Tile other : state.teams.get(tile.getTeam()).cores){ CoreEntity oe = other.entity(); oe.storageCapacity = entity.storageCapacity; }