Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

[Retail] C_Item.DoesItemExistByID() always returns true #449

Open exochron opened 1 year ago

exochron commented 1 year ago

In Patch 10.1.0 the function C_Item.DoesItemExistByID() always returns true for any positive number. I don't know exactly when it stopped working. I guess it probably happened sometime during Dragonflight.

/dump C_Item.DoesItemExistByID(1)
/dump C_Item.DoesItemExistByID(999999)

However it does still works properly in Classic and Wrath.

exochron commented 1 year ago

For my addon I got a little workaround. Feel free to use and tweak :)

local DoesItemExistInGame
if true == C_Item.DoesItemExistByID(1) then
    DoesItemExistInGame = function(itemId)
        return C_Item.GetItemIconByID(itemId) ~= 134400 -- question icon
    end
else
    DoesItemExistInGame = function(itemId)
        return C_Item.DoesItemExistByID(itemId)
    end
end
Ghostopheles commented 1 year ago

Related - I suspect the same thing causing this issue also applies to the GET_ITEM_INFO_RECEIVED event fired after running GetItemInfo. The event's payload is the itemID and a boolean indicating success. Expected behavior of that boolean value would be; true for valid items, false for blocked/forbidden items, and nil for items that don't exist. Right now, all non-existent items return false, as if they exist and are blocked/forbidden.

This could be by design, but no way to know for sure.

zeptognome commented 2 months ago

This issue exists now on Cata Classic (beta)

zeptognome commented 2 months ago

And Classic Season of Discovery 1.15.2.54332