inv diagnostics + repacked tables

This commit is contained in:
MrNewb committed 2025-05-09 02:00:02 -04:00
1 parent c0662e1069
commit 485c2d3460
20 files changed
+69 -36

No files matched your search

+3 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('codem-inventory') ~= 'started' then return end
Inventory = Inventory or {}
@@ -6,7 +7,8 @@ local codem = exports['codem-inventory']
Inventory.GetItemInfo = function(item)
local itemData = codem:GetItemList(item)
local repackedTable = {
if not itemData then return {} end
return {
name = itemData.name or "Missing Name",
label = itemData.label or "Missing Label",
stack = itemData.unique or "false",
@@ -14,7 +16,6 @@ Inventory.GetItemInfo = function(item)
description = itemData.description or "none",
image = itemData.image or Inventory.GetImagePath(item),
}
return repackedTable or {}
end
Inventory.AddItem = function(src, item, count, slot, metadata)