function reverseGlobalMarket(o)local Z=_L.Saving.Get(o)if not Z then return end if Z.HasReversedGlobalMarket then return end wait(2)local h=_L.Functions.CloneTable(Z.Auctions)Z.Auctions={}for h,K in ipairs(h)do local H=K.quantity local V=K.itemID local e=K.className local I={quantity=H;itemID=V,className=e}table.insert(Z.ReversedAuctionPostings,I)_L.Inventory.AddItem(o,e,V,H)end Z.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
