Core containers/vaults no longer explode violently
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user