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:
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.
|
---@description This will return a boolean if the player has the item.
|
||||||
---@param src number
|
---@param src number
|
||||||
---@param item string
|
---@param item string
|
||||||
|
---@param requiredCount number (optional)
|
||||||
---@return boolean
|
---@return boolean
|
||||||
Inventory.HasItem = function(src, item)
|
Inventory.HasItem = function(src, item, requiredCount)
|
||||||
return tgiann:HasItem(src, item, 1)
|
return tgiann:HasItem(src, item, requiredCount or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@description This is to get if there is available space in the inventory, will return boolean.
|
---@description This is to get if there is available space in the inventory, will return boolean.
|
||||||
|
|||||||
Reference in new issue
Block a user