From 9198068a198b15b54488c51eff8e9260a2d80df8 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Thu, 15 May 2025 19:55:14 +0100 Subject: [PATCH] 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 --- shared/inventories.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/inventories.lua b/shared/inventories.lua index d5aac0b..0f58900 100644 --- a/shared/inventories.lua +++ b/shared/inventories.lua @@ -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")