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:
1 parent
c985261cf3
commit
a4959882b3
2 files changed
+6
-6
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user