View Single Post
08/28/23, 02:10 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
I guess the function SellInventoryItem will stop to work if you try to pass in a non-sellable one?

GenerateFullSlotData returns a table bagCache and you should check which items are in there, I guess all inventoty items as you did not specify any filterunction as 1st param!

So maybe you need to stay with using GenerateFullSlotData BUT specify a filterfunction as 1st param which filters non-sellable items.
There should exist a function which returns that info, by checking item's price == 0 e.g.
According to ZOs all non sellable ones will be 0 gold cost meanwhile (current patch notes).

Check if you can use this function:
CanSellItem(inventorySlot)

I hope the inventorySlot is the data (see below) table here.



Edit:
After checking my code I'm using

Code:
for _, data in pairs(bagCache) do
local bagId = data.bagId
local slotIndex = data.slotIndex
instead of using the _ as bagSlot (slotIndex) like in your code above.
Maybe they are the same though so might not have any impact, can be used either way?

Last edited by Baertram : 08/28/23 at 02:22 AM.
  Reply With Quote