Stanzilla/WoWUIBugs

C_TransmogCollection.PlayerHasTransmog APIs are slightly inconsistent

Opened this issue · 0 comments

The C_TransmogCollection.PlayerHasTransmogByItemInfo API returns inconsistent values compared to its fellow brethren under certain circumstances.

It isn't clear if this is actually a bug, but when this one function claims appearances aren't learned whilst all others say they are, it's certainly confusing at the very least.

Scenario

I'll use the item Ironpelt Helm for this example, starting with an item link obtained by shift-clicking it in the wardrobe collection panel.

  • Item ID: 128130
  • ItemInfo: item:128130::::::::80:577:::1:3524::::::
  • ItemModifiedAppearanceID: 73204
  • ItemAppearanceID: 25983

In my case while the appearance is fundamentally known through one source, I don't own all possible sources of the item. This may be an important factor for the issue. The full mapping of sources for this appearance and whether or not I own them can be found below.

ItemModifiedAppearanceID Learned ItemID
72898 No 128034
73078 No 128079
73204 Yes 128130
80938 No 139627
80939 No 139627
80940 No 139627

Note that the item needs loading into the cache before some of the APIs will begin to work;

/run C_Item.RequestLoadItemDataByID(128310)

C_TransmogCollection.PlayerHasTransmog

Calling this function with the itemAppearanceModID parameter set to 4 expectedly returns true.

local itemInfo = "item:128130::::::::80:577:::1:3524::::::"
local itemID = select(2, string.split(":", itemInfo, 3))
local itemAppearanceModID = 4
print(C_TransmogCollection.PlayerHasTransmog(itemID, itemAppearanceModID))  -- true

C_TransmogCollection.GetItemInfo

Calling this function correctly returns the expected values for ItemAppearanceID and ItemModifiedAppearanceID.

local itemInfo = "item:128130::::::::80:577:::1:3524::::::"
print(C_TransmogCollection.GetItemInfo(itemInfo))  -- 25983, 73204

C_TransmogCollection.PlayerHasTransmogItemModifiedAppearance

Calling this function with its rather impressively wordy name expectedly returns true.

local itemInfo = "item:128130::::::::80:577:::1:3524::::::"
local itemModifiedAppearanceID = select(2, C_TransmogCollection.GetItemInfo(itemInfo))
print(C_TransmogCollection.PlayerHasTransmogItemModifiedAppearance(itemModifiedAppearanceID))  -- true

C_TransmogCollection.PlayerHasTransmogByItemInfo

Calling this function directly passing in the item string unexpectedly returns false, which seems counterintuitive at best.

My personal expectation for this API would be that it returns true on the sole basis that the previous example - which obtains the ItemModifiedAppearanceID from the exact same item string via the GetItemInfo call and feeds that into PlayerHasTransmogItemModifiedAppearance - itself reports true.

I'm not sure if the false I'm seeing here is because I don't have all sources for the appearance learned, but it may be related. If this is the case, perhaps this function should instead be returning a tristate value for unlearned, partially learned, and fully learned.

local itemInfo = "item:128130::::::::80:577:::1:3524::::::"
print(C_TransmogCollection.PlayerHasTransmogByItemInfo(itemInfo))  -- false