Skip to content

Commit

Permalink
Cata Classic is missing C_TransmogCollection.PlayerHasTransmogByItemInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
kemayo committed May 6, 2024
1 parent f49c897 commit 25f3c41
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion loot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ if ns.CLASSIC then
ATLAS_CHECK, ATLAS_CROSS = "Tracker-Check", "Objective-Fail"
end

local function PlayerHasTransmogByItemInfo(itemLinkOrID)
-- Cata classic is specifically missing C_TransmogCollection.PlayerHasTransmogByItemInfo
if C_TransmogCollection.PlayerHasTransmogByItemInfo then
return C_TransmogCollection.PlayerHasTransmogByItemInfo(itemLinkOrID)
end
local itemID = GetItemInfoInstant(itemLinkOrID)
if itemID then
-- this is a bit worse, because of items with varying appearances based on the link-details
-- but because this path should only be hit in classic, we should be fine
return C_TransmogCollection.PlayerHasTransmog(itemID)
end
end

-- we need non-localized covenant names for atlases
-- can't use the texturekit value from covenant data, since the atlas I want doesn't conform to it
local covenants = {
Expand Down Expand Up @@ -100,7 +113,7 @@ local function HasAppearance(itemLinkOrID)
-- changes their settings.
return hasAppearanceCache[itemID]
end
if C_TransmogCollection.PlayerHasTransmogByItemInfo(itemLinkOrID) then
if PlayerHasTransmogByItemInfo(itemLinkOrID)then
-- short-circuit further checks because this specific item is known
hasAppearanceCache[itemID] = true
return true
Expand Down

0 comments on commit 25f3c41

Please sign in to comment.