"Restrict to Soulbound items" doesn't work
potat0nerd opened this issue ยท 4 comments
found this while searching around https://wowpedia.fandom.com/wiki/API_C_Item.IsBound
Here is some code I used to move into version 6.4 peddler.lua not sure if it still works (the first --local function line after mikfhan begin gives a hint of what line all of it's supposed to replace):
-- mikfhan begin: check soulbound
--local function isSoulbound(itemLink)
local function isSoulbound(itemLink, bagNumber, slotNumber)
if bagNumber and slotNumber then
if not soulboundToolip or not C_Item.DoesItemExist(soulboundToolip) then
soulboundToolip = ItemLocation:CreateEmpty()
end
soulboundToolip:SetBagAndSlot(bagNumber, slotNumber)
return C_Item.IsBound(soulboundToolip)
else
if soulboundToolip and C_Item.DoesItemExist(soulboundToolip) then
soulboundToolip:Clear()
soulboundToolip = nil
end
end
-- mikfhan finish
Then anywhere isSoulbound is mentioned, it should also be called with the item's bagnumber and slotnumber.
Might also require itemIsToBeSold + displayCoins + toggleItemPeddling taking bagnumber and slotnumber inputs.
It is SOME versions ago though, so perhaps something else/more is required now to work in retail and classic.
this was my solution:
local function isSoulbound(bagNumber,slotNumber)
local item = Item:CreateFromBagAndSlot(bagNumber, slotNumber)
local location = item:GetItemLocation()
local soulbound = C_Item.IsBound(location)
return soulbound
end