Clean up unload

This commit is contained in:
2025-03-30 20:36:31 +02:00
parent dc5080039a
commit 3d2d17941f

View File

@@ -125,82 +125,6 @@ local function tryUnloadCursorItem()
for _, slot in ipairs(slots) do
tryUnloadSlot(slot)
end
-- local canAccept = inventorySlot.CanBePutInSlot(item, inventorySlot.slotIndex, item.Condition)
-- if canAccept then
-- toUnload[#toUnload + 1] = inventoryItem
-- end
-- local slots = findSlotsThat(inventory, function(slot)
-- local canAccept
-- end)
-- local inventory = targetInventory
-- -- MyModGlobal.debugPrint(string.format("Target inventory: %s", tostring(inventory)))
-- if not inventory then
-- local controlledCharacter = Character.Controlled
-- if not controlledCharacter then
-- -- MyModGlobal.debugPrint("No controlled character found")
-- return
-- end
-- local cinventory = controlledCharacter.Inventory
-- if not cinventory or not cinventory.slots then
-- -- MyModGlobal.debugPrint("No inventory found")
-- return
-- end
-- local bagSlot = cinventory.slots[MyModGlobal.BAG_SLOT]
-- if not bagSlot or not bagSlot.items or not bagSlot.items[1] then
-- -- MyModGlobal.debugPrint("No bag slot found")
-- return
-- end
-- local bagItem = bagSlot.items[1]
-- if not bagItem or not bagItem.OwnInventory then
-- -- MyModGlobal.debugPrint("Bag item has no own inventory")
-- return
-- end
-- local bagInventory = bagItem.OwnInventory
-- if not bagInventory or not bagInventory.slots then
-- -- MyModGlobal.debugPrint("Bag inventory has no slots")
-- return
-- end
-- inventory = bagInventory
-- end
-- if not inventory then
-- -- MyModGlobal.debugPrint("No inventory found")
-- return
-- end
-- local itemTree
-- itemTree, err = quickstack.buildItemTree(inventory)
-- if err then
-- -- MyModGlobal.debugPrint(string.format("Error building item tree: %s", err))
-- return
-- end
-- itemTree = quickstack.sortItemTree(itemTree)
-- local itemsToMove = {}
-- local now = Timer.GetTime()
-- for _, slot in ipairs(slots) do
-- local runAfter = slotThrottle[slot] or 0
-- if now < runAfter then
-- goto continue
-- end
-- -- MyModGlobal.debugPrint(string.format("Enqueuing slot: %s, before: %d", tostring(slot), #itemsToMove))
-- utils.enqueueSlot(slot.slot, itemsToMove)
-- -- MyModGlobal.debugPrint(string.format("Enqueuing slot: %s, after: %d", tostring(slot), #itemsToMove))
-- slotThrottle[slot] = now + 1
-- ::continue::
-- end
-- -- for _, item in ipairs(itemsToMove) do
-- -- MyModGlobal.debugPrint(string.format("Enqueued item: %s", tostring(item)))
-- -- end
-- -- -- MyModGlobal.debugPrint(string.format("Enqueued %d items from the inventory slot", #itemsToMove))
-- -- MyModGlobal.DumpTable(itemTree)
-- quickstack.tryMoveItems(itemsToMove, itemTree, true)
-- -- local errors = quickstack.tryMoveItems(itemsToMove, itemTree, true)
-- -- for _, error in ipairs(errors) do
-- -- MyModGlobal.debugPrint(string.format("Error moving item: %s", error))
-- -- end
end
return {