diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 3ccc414500..b98b8bf470 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1018,6 +1018,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } + /** @return the cap for item amount calculations, used when this block explodes. */ + public int explosionItemCap(){ + return block.itemCapacity; + } + /** Called when the block is destroyed. The tile is still intact at this stage. */ public void onDestroyed(){ float explosiveness = block.baseExplosiveness; @@ -1026,7 +1031,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, if(block.hasItems){ for(Item item : content.items()){ - int amount = items.get(item); + int amount = Math.min(items.get(item), explosionItemCap()); explosiveness += item.explosiveness * amount; flammability += item.flammability * amount; power += item.charge * amount * 100f; diff --git a/core/src/mindustry/world/blocks/storage/StorageBlock.java b/core/src/mindustry/world/blocks/storage/StorageBlock.java index 006d462e6f..be74e98402 100644 --- a/core/src/mindustry/world/blocks/storage/StorageBlock.java +++ b/core/src/mindustry/world/blocks/storage/StorageBlock.java @@ -83,6 +83,12 @@ public class StorageBlock extends Block{ return itemCapacity; } + @Override + public int explosionItemCap(){ + //when linked to a core, containers/vaults are made significantly less explosive. + return linkedCore != null ? Math.min(itemCapacity/60, 6) : itemCapacity; + } + @Override public void drawSelect(){ if(linkedCore != null){