mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-23 21:12:52 -08:00
Don't add unit drops to core if the core is full (#222)
This commit is contained in:
parent
3a785c166e
commit
4e2c3049a0
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue