mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 22:36:04 +01:00
Adjust hasItem function for QS-Inv
Apparently qs-inv reports two variables on the item data for how you have `count` and `amount` while other inventories appear to only have one of those I'm assuming for compatibility sake Apparently the `count` is updated differently, and `hasItem()` was checking for this first I've swapped round the checks and appears to work better
This commit is contained in:
@@ -50,8 +50,9 @@ function hasItem(items, amount, src)
|
||||
|
||||
local count = 0
|
||||
for _, itemData in pairs(grabInv) do
|
||||
jsonPrint(itemData)
|
||||
if itemData and itemData.name == item then
|
||||
count += (itemData.count or itemData.amount or 1)
|
||||
count += (itemData.amount or itemData.count or 1)
|
||||
end
|
||||
end
|
||||
foundInv = foundInv:gsub("%-", "^7-^6"):gsub("%_", "^7_^6")
|
||||
|
||||
Reference in New Issue
Block a user