First stack submarine items then player items

This commit is contained in:
2025-03-31 03:51:45 +02:00
parent 5e33806c92
commit 1b713a858c
2 changed files with 7 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ local LOAD_MAP = {
},
anechoicdivingsuit = { oxygentank = 1, },
handheldsonar = { batterycell = 1 },
underwaterscooter = { batterycell = 1 },
}
return LOAD_MAP

View File

@@ -353,7 +353,7 @@ local function stackAllToCursor()
end
for _, slot in ipairs(slots) do
local item
local item, predicate
if not slot.slot.items or #slot.slot.items == 0 then
MyModGlobal.debugPrint("No items in slot")
goto continue
@@ -361,7 +361,7 @@ local function stackAllToCursor()
item = slot.slot.items[1]
MyModGlobal.debugPrint(string.format("Stacking all items to %s", item.Prefab.Identifier.Value))
utils.enqueueAllOwnedItems({}, function(ititem)
predicate = function(ititem)
if ititem.Prefab.Identifier.Value == item.Prefab.Identifier.Value then
if item == ititem then return false end
-- We are moving items in the predicate because we expect to only
@@ -385,7 +385,10 @@ local function stackAllToCursor()
return false, true
end
end
end)
end
utils.enqueueAllSubmarineItems({}, predicate)
utils.enqueueAllPlayerItems({}, predicate)
::continue::
end