mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-26 08:41:12 -07:00
Fixed units without an inventory being able to withdraw items
This commit is contained in:
parent
f464868934
commit
b911ef98bb
2 changed files with 1 additions and 2 deletions
|
|
@ -123,7 +123,7 @@ public class UnitInventory implements Saveable{
|
|||
}
|
||||
|
||||
public boolean canAcceptItem(Item type){
|
||||
return !hasItem() || (item.item == type && unit.getItemCapacity() - item.amount > 0);
|
||||
return (!hasItem() && 1 <= unit.getItemCapacity()) || (item.item == type && unit.getItemCapacity() - item.amount > 0);
|
||||
}
|
||||
|
||||
public boolean canAcceptItem(Item type, int amount){
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ public class BlockInventoryFragment implements Fragment {
|
|||
if(!canPick.get() || items[f] == 0) return;
|
||||
int amount = Math.min(Inputs.keyDown("item_withdraw") ? items[f] : 1, player.inventory.itemCapacityUsed(item));
|
||||
CallBlocks.requestItem(player, tile, item, amount);
|
||||
|
||||
});
|
||||
table.add(image);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue