FIX - QB-Core - Framework/Inventory - Item properties fix

QB-Core Framework.
Some inventories has item property `count` instead of `amount`.
+/- Added fallback to `count` if `amount` doesn't exists.
This commit is contained in:
ONyambura committed 2025-09-26 19:02:30 +03:00
1 parent c985261cf3
commit a4959882b3
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -184,7 +184,7 @@ Framework.GetItemCount = function(item)
local count = 0
for _, v in pairs(frameworkInv) do
if v.name == item then
count = count + v.amount
count = count + (v.amount or v.count)
end
end
return count
@@ -199,7 +199,7 @@ Framework.GetPlayerInventory = function()
table.insert(items, {
name = v.name,
label = v.label,
count = v.amount,
count = v.amount or v.count,
slot = v.slot,
metadata = v.info,
stack = v.unique,