From 4e2c3049a071ae76bf6cc8df0e87b84da52d23c0 Mon Sep 17 00:00:00 2001 From: iczero Date: Wed, 19 Sep 2018 19:47:32 -0700 Subject: [PATCH] Don't add unit drops to core if the core is full (#222) --- core/src/io/anuke/mindustry/entities/units/UnitDrops.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java index de91dddce6..e6a2c776f2 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java @@ -35,7 +35,8 @@ public class UnitDrops{ if(Mathf.chance(0.03)){ int amount = Mathf.random(20, 40); - Call.transferItemTo(item, amount, unit.x + Mathf.range(2f), unit.y + Mathf.range(2f), core.tile); + amount = core.tile.block().acceptStack(item, amount, core.tile, null); + if (amount > 0) Call.transferItemTo(item, amount, unit.x + Mathf.range(2f), unit.y + Mathf.range(2f), core.tile); } } }