Mark parent inventory if slot is not an inventory

This commit is contained in:
2025-03-30 17:14:16 +02:00
parent 1c68f52b28
commit bbb3ab4058

View File

@@ -126,15 +126,21 @@ local function setTargetInventory()
end
if not slot.items or #slot.items == 0 then
MyModGlobal.debugPrint("Slot is empty")
print(string.format("Setting target inventory to %s", tostring(itemInv)))
targetInventory = itemInv
return
end
local item = slot.items[1]
if not item then
MyModGlobal.debugPrint("Slot is empty")
print(string.format("Setting target inventory to %s", tostring(itemInv)))
targetInventory = itemInv
return
end
if not item.OwnInventory then
MyModGlobal.debugPrint("Item has no own inventory")
print(string.format("Setting target inventory to %s", tostring(itemInv)))
targetInventory = itemInv
return
end
print(string.format("Setting target inventory to %s", tostring(item.OwnInventory)))