Support optional requiredCount in HasItem

Add an optional requiredCount parameter to Inventory.HasItem and default it to 1 when not provided. The function now forwards the count to tgiann:HasItem, allowing callers to check for multiple item quantities; updated the LuaDoc param annotation accordingly.
This commit is contained in:
MrNewb committed 2026-06-06 22:36:44 -04:00
1 parent a4d984b951
commit e8ba8e1837
1 file changed
+3 -2
@@ -129,9 +129,10 @@ end
---@description This will return a boolean if the player has the item.
---@param src number
---@param item string
---@param requiredCount number (optional)
---@return boolean
Inventory.HasItem = function(src, item)
return tgiann:HasItem(src, item, 1)
Inventory.HasItem = function(src, item, requiredCount)
return tgiann:HasItem(src, item, requiredCount or 1)
end
---@description This is to get if there is available space in the inventory, will return boolean.