Maybe fix quickstack recurse
This commit is contained in:
@@ -249,27 +249,13 @@ local function stackToContainer(item)
|
|||||||
itemTree = sortItemTree(itemTree)
|
itemTree = sortItemTree(itemTree)
|
||||||
|
|
||||||
local toMove = {}
|
local toMove = {}
|
||||||
local total = 0
|
for slot in parentInventory.slots do
|
||||||
utils.enqueueInventory(parentInventory, toMove, function(iterationItem)
|
for slotItem in slot.items do
|
||||||
total = total + 1
|
if slotItem.Prefab.Identifier.Value ~= item.Prefab.Identifier.Value then
|
||||||
-- Get all items that aren't our mouseover item
|
toMove[#toMove + 1] = slotItem
|
||||||
if iterationItem.Equals(item) then
|
|
||||||
-- MyModGlobal.debugPrint(string.format("Skipping item: %s", iterationItem.Prefab.Identifier.Value))
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
-- This won't work for nested containers
|
|
||||||
-- But making it work with nested containers is a pain in the ass
|
|
||||||
-- So we'll just not do that for now
|
|
||||||
if iterationItem.ParentInventory and iterationItem.ParentInventory.Equals(itemInventory) then
|
|
||||||
-- MyModGlobal.debugPrint(string.format("Skipping item: %s", iterationItem.Prefab.Identifier.Value))
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
if total >= 10000 then
|
|
||||||
MyModGlobal.debugPrint("Too many items to stack, stopping")
|
|
||||||
return false, true
|
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
end)
|
|
||||||
MyModGlobal.debugPrint(string.format("Enqueued %d items to stack", #toMove))
|
MyModGlobal.debugPrint(string.format("Enqueued %d items to stack", #toMove))
|
||||||
-- dump(toMove)
|
-- dump(toMove)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user