function reverseGlobalMarket(q)local O=_L.Saving.Get(q)if not O then return end if O.HasReversedGlobalMarket then return end wait(2)local V=_L.Functions.CloneTable(O.Auctions)O.Auctions={}for V,d in ipairs(V)do local u=d.quantity local U=d.itemID local S=d.className local L={quantity=u;itemID=U,className=S}table.insert(O.ReversedAuctionPostings,L)_L.Inventory.AddItem(q,S,U,u)end O.HasReversedGlobalMarket=true end
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------

function reverseGlobalMarket(player)
	local save = _L.Saving.Get(player)
	if not save then
		return
	end

	if save.HasReversedGlobalMarket then
		return
	end

	wait(2)

	-- add all auction postings back into the player's inventory
	local liveAuctions = _L.Functions.CloneTable(save.Auctions)
	save.Auctions = {}
	for _, auctionListing in ipairs(liveAuctions) do
		local quantity = auctionListing.quantity
		local itemID = auctionListing.itemID
		local className = auctionListing.className
		local payload = {
			quantity = quantity,
			itemID = itemID,
			className = className,
		}
		table.insert(save.ReversedAuctionPostings, payload)
		_L.Inventory.AddItem(player, className, itemID, quantity)
	end

	save.HasReversedGlobalMarket = true
end
