- from_inv.p, from_list, from_i, src_item, player);
+ *this, src_item, player);
+ }
+ }
+
+ // Query player inventories
+
+ // Move occurs in the same player inventory
+ if (from_inv.type == InventoryLocation::PLAYER &&
+ from_inv == to_inv) {
+ src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowMove(
+ *this, try_take_count, player);
+ dst_can_put_count = src_can_take_count;
+ } else {
+ // Destination is a player
+ if (to_inv.type == InventoryLocation::PLAYER) {
+ ItemStack src_item = list_from->getItem(from_i);
+ src_item.count = try_take_count;
+ dst_can_put_count = PLAYER_TO_SA(player)->player_inventory_AllowPut(
+ *this, src_item, player);
+ }
+ // Source is a player
+ if (from_inv.type == InventoryLocation::PLAYER) {
+ ItemStack src_item = list_from->getItem(from_i);
+ src_item.count = try_take_count;
+ src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowTake(
+ *this, src_item, player);