From 8938ffee166c4246431afc9f23585719b68321d3 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Wed, 10 Jun 2020 18:38:12 +0300 Subject: [PATCH] fix create talent cache in first entering the world --- WeakAuras/WeakAuras.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 6071779..8f67d68 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1657,6 +1657,7 @@ loadedFrame:RegisterEvent("ADDON_LOADED"); loadedFrame:RegisterEvent("PLAYER_LOGIN"); loadedFrame:RegisterEvent("PLAYER_ENTERING_WORLD"); loadedFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); +loadedFrame:RegisterEvent("SPELL_UPDATE_USABLE"); loadedFrame:SetScript("OnEvent", function(self, event, addon) if(event == "ADDON_LOADED") then if(addon == ADDON_NAME) then @@ -1725,6 +1726,9 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon) WeakAuras.CreateTalentCache() -- It seems that GetTalentInfo might give info about whatever class was previously being played, until PLAYER_ENTERING_WORLD WeakAuras.UpdateCurrentInstanceType(); end + elseif(event == "SPELL_UPDATE_USABLE") then + callback = WeakAuras.CreateTalentCache; + WeakAuras.frames["Addon Initialization Handler"]:UnregisterEvent("SPELL_UPDATE_USABLE") elseif(event == "ACTIVE_TALENT_GROUP_CHANGED") then callback = WeakAuras.CreateTalentCache; elseif(event == "PLAYER_REGEN_ENABLED") then