ox_inventory icon indicating copy to clipboard operation
ox_inventory copied to clipboard

errors with qbox

Open ChrisUKGaming opened this issue 1 year ago • 2 comments

Describe the bug 12:48:55 PM [ script:ox_inventory] SCRIPT ERROR: @ox_inventory/modules/inventory/server.lua:926: attempt to compare number with nil 12:48:55 PM [ script:ox_inventory] > new StackDumpError (@oxmysql/citizen:/scripting/v8/main.js:405) 12:48:55 PM [ script:ox_inventory] > (@oxmysql/citizen:/scripting/v8/main.js:425) 12:48:55 PM [ script:ox_inventory] > (@oxmysql/citizen:/scripting/v8/main.js:86) 12:48:55 PM [ script:ox_inventory] > Number.__cfx_wrap_29466 (@oxmysql/citizen:/scripting/v8/main.js:24) 12:48:55 PM [ script:ox_inventory] > (@oxmysql/citizen:/scripting/v8/main.js:30) 12:48:55 PM [ script:ox_inventory] > (@oxmysql/citizen:/scripting/v8/main.js:83) 12:48:55 PM [ script:ox_inventory] > rawExecute (@oxmysql/dist/build.js:26240) 12:48:55 PM [ script:ox_inventory] > process.processTicksAndRejections (node:internal/process/task_queues:105)

Framework qbox

Resource version version '2.44.1'

To Reproduce open inventory and load into the server

Expected behavior No error

Screenshots If applicable, add screenshots to help explain your problem.

ChrisUKGaming avatar Feb 23 '25 17:02 ChrisUKGaming

the line and area around it...

---@param inv inventory ---@param item table | string ---@param count number ---@param metadata? table function Inventory.SetItem(inv, item, count, metadata) if type(item) ~= 'table' then item = Items(item) end

if item and count >= 0 then
	inv = Inventory(inv) --[[@as OxInventory]]

	if inv then
		inv.changed = true
		local itemCount = Inventory.GetItem(inv, item.name, metadata, true) --[[@as number]]

		if count > itemCount then
			count -= itemCount
			return Inventory.AddItem(inv, item.name, count, metadata)
		elseif count <= itemCount then
			itemCount -= count
			return Inventory.RemoveItem(inv, item.name, itemCount, metadata)
		end
	end
end

end exports('SetItem', Inventory.SetItem)

ChrisUKGaming avatar Feb 23 '25 17:02 ChrisUKGaming

Please provide steps to Reproduce this issue

Ehbw avatar Mar 01 '25 23:03 Ehbw