blooblahguy / BigDumbLootCouncil

5 stars 6 forks source link

Figured out why relics aren't showing when looting. #9

Closed Ramurotand closed 6 years ago

Ramurotand commented 6 years ago

I dug into your code some and looked to see why relics don't always show up sometimes for certain classes. Here's the ultimate reason: Relic info isn't available for all specs upon first launch of the artifact window and comes later. Here's the etrace of me running your bdlc:GetRelics(rt) in functions.lua (line 449) using /dump bdlc:GetRelics("arcane") on a balance druid: https://imgur.com/m8MEG6U. The second time I ran it then it has the info already and works correctly like one would expect returning the 2 arcane relic links. Looks like until ARTIFACT_RELIC_INFO_RECEIVED events are done the first time it fails and is why relics don't show up all the time.

Calling C_ArtifactUI.GetEquippedArtifactRelicInfo(1) C_ArtifactUI.GetEquippedArtifactRelicInfo(2) C_ArtifactUI.GetEquippedArtifactRelicInfo(3) early and expecting an empty result might be a simple answer like when first identifying an item as a relic to ensure the above events have transpired before bdlc:GetRelics(rt) runs.

blooblahguy commented 6 years ago

Pushing an update that should fix this issue. Ideally I don't have to do a full event hook on this, as that a good bit of work. But previously I assumed blizzard loaded your relic info just from inspecting your weapons, but turns out you also need to call GetRelicInfo. We're now doing this on "ENCOUNTER_END" and "ADDON_LOADED"

Ramurotand commented 6 years ago

This is closed, but letting you know there were no lua errors or items not showing up in 2.27 this week. Thank you for the hard work!