You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2025. It is now read-only.
Describe the bug
If you have an inventory that is full of stuff (stackables and non-stackables), and then you try and use CanCarryItem with a stackable item that's in the inventory and nil metadata, it'll say that you can't carry the item.
Tracked it down to being related to how { type = metadata or nil } table gets treated by GetItemSlots as a hashmap by table.type, which is used in the strict metadata check.
Framework
QBox
Resource version
2.44.1
To Reproduce
Fill up your inventory except one slot with a non-stackable item.
In that one slot, add an item that is stackable with no metadata.
In /runcode or a resource, run the following code, making sure its ran server-sided.
localinventory=1localitemName="burger"localcount=10localmetadata=nilifexports.ox_inventory:CanCarryItem(inventory, itemName, count, metadata) thenlocaladdItemSuccess, reason=exports.ox_inventory:AddItem(inventory, itemName, count, metadata)
ifaddItemSuccessthenprint("added item successfully")
elseprint("failed to add item", reason)
endelseprint("failed to add item, cannot carry item")
end
Expected behavior
The item that we're trying to add, should've added into the stack in the inventory.
Screenshots Image shows a full inventory, with the burger being the target item that i was trying to check with CanCarryItem The Facade Laptops are non-stackable