This commit is contained in:
Anuken
2020-09-06 14:54:10 -04:00
parent 0a3193f1d6
commit 27d9f965be
2 changed files with 4 additions and 2 deletions

View File

@@ -45,9 +45,11 @@ public class BlockInventoryFragment extends Fragment{
@Remote(called = Loc.server, targets = Loc.both, forward = true)
public static void requestItem(Player player, Building tile, Item item, int amount){
if(player == null || tile == null || !tile.interactable(player.team())) return;
amount = Mathf.clamp(amount, 0, player.unit().itemCapacity());
amount = Math.min(player.unit().maxAccepted(item), amount);
int fa = amount;
if(amount == 0) return;
if(net.server() && (!Units.canInteract(player, tile) ||
!netServer.admins.allowAction(player, ActionType.withdrawItem, tile.tile(), action -> {
action.item = item;