origin inventory patch

the getinventory export returns a table of nested values, inside there is a inventory table. This gets us by on the compatibility. It appears that many of the exports have changed, I have tested this on the latest version with a resource that makes use of these items. Also they use amount, I "think" they used to use count but im 100% they use metadata & info tables.
This commit is contained in:
MrNewb committed 2025-06-09 15:47:25 -04:00
1 parent 2ed71df1b6
commit 6ae273544d
1 file changed
+5 -3
@@ -106,7 +106,8 @@ end
---@param src number
---@return table
Inventory.GetPlayerInventory = function(src)
return origin:GetInventory(src)
local playerInv = origin:GetInventory(src)
return playerInv.inventory or {}
end
---Returns the specified slot data as a table.
@@ -115,7 +116,8 @@ end
---@param slot number
---@return table
Inventory.GetItemBySlot = function(src, slot)
local inv = origin:getInventory(src)
local playerInv = origin:getInventory(src)
local inv = playerInv.inventory or {}
for k, v in pairs(inv) do
if v.slot == slot then
return {
@@ -124,7 +126,7 @@ Inventory.GetItemBySlot = function(src, slot)
metadata = v.metadata,
slot = v.slot,
label = v.label,
count = v.count
count = v.amount
}
end
end