Skip to content

Commit

Permalink
fix(server/inventory): support for item name in GetItemSlots (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
antond15 authored Feb 21, 2024
1 parent 3f70927 commit 3c7e251
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/inventory/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,10 @@ exports('Search', Inventory.Search)
---@param item table | string
---@param metadata? table
function Inventory.GetItemSlots(inv, item, metadata)
inv = Inventory(inv) --[[@as OxInventory]]
if type(item) ~= 'table' then item = Items(item) end
if not item then return end

inv = Inventory(inv) --[[@as OxInventory]]
if not inv?.slots then return end

local totalCount, slots, emptySlots = 0, {}, inv.slots
Expand Down

0 comments on commit 3c7e251

Please sign in to comment.