@@ -801,20 +801,22 @@ if WeakAuras.IsRetail() then
801801 end
802802end
803803
804- --- @param index integer
804+ --- @param spellId integer
805805--- @return boolean hasTalent
806- --- @return number ? talentId
807- function WeakAuras .CheckPvpTalentByIndex ( index )
806+ --- @return number ? spellid
807+ function WeakAuras .CheckPvpTalentBySpellId ( spellId )
808808 local checkTalentSlotInfo = C_SpecializationInfo .GetPvpTalentSlotInfo (1 )
809809 if checkTalentSlotInfo then
810- local checkTalentId = checkTalentSlotInfo .availableTalentIDs [index ]
811810 for i = 1 , 3 do
812811 local talentSlotInfo = C_SpecializationInfo .GetPvpTalentSlotInfo (i )
813- if talentSlotInfo and (talentSlotInfo .selectedTalentID == checkTalentId ) then
814- return true , checkTalentId
812+ if talentSlotInfo and talentSlotInfo .selectedTalentID then
813+ local selectedSpellId = select (6 , GetPvpTalentInfoByID (talentSlotInfo .selectedTalentID ))
814+ if selectedSpellId == spellId then
815+ return true , spellId
816+ end
815817 end
816818 end
817- return false , checkTalentId
819+ return false , spellId
818820 end
819821 return false
820822end
@@ -1663,17 +1665,23 @@ Private.load_prototype = {
16631665 single_spec = GetSpecialization ();
16641666 end
16651667
1666- -- print ("Using talent cache", single_class, single_spec);
16671668 -- If a single specific class was found, load the specific list for it
1669+ if not single_class then
1670+ single_class = select (2 , UnitClass (" player" ))
1671+ end
1672+ if not single_spec then
1673+ single_spec = GetSpecialization ()
1674+ end
1675+
16681676 if (single_class and Private .pvp_talent_types_specific [single_class ]
16691677 and single_spec and Private .pvp_talent_types_specific [single_class ][single_spec ]) then
16701678 return Private .pvp_talent_types_specific [single_class ][single_spec ];
16711679 else
1672- return Private . pvp_talent_types ;
1680+ return {}
16731681 end
16741682 end
16751683 end ,
1676- test = " WeakAuras.CheckPvpTalentByIndex (%d)" ,
1684+ test = " WeakAuras.CheckPvpTalentBySpellId (%d)" ,
16771685 enable = WeakAuras .IsRetail (),
16781686 hidden = not WeakAuras .IsRetail (),
16791687 events = {" PLAYER_PVP_TALENT_UPDATE" }
@@ -7135,9 +7143,9 @@ Private.event_prototypes = {
71357143 local index = %s
71367144 local activeName, activeIcon, _
71377145
7138- local active, talentId = WeakAuras.CheckPvpTalentByIndex (index)
7139- if talentId then
7140- _, activeName , activeIcon = GetPvpTalentInfoByID(talentId )
7146+ local active, spellId = WeakAuras.CheckPvpTalentBySpellId (index)
7147+ if spellId then
7148+ activeName, _ , activeIcon = Private.ExecEnv.GetSpellInfo(spellId )
71417149 end
71427150 ]] ):format (index or 0 ))
71437151 if (inverse ) then
@@ -7158,9 +7166,9 @@ Private.event_prototypes = {
71587166 table.insert (ret , ([[
71597167 if (not active) then
71607168 local index = %s
7161- active, talentId = WeakAuras.CheckPvpTalentByIndex (index)
7162- if active and talentId then
7163- _, activeName , activeIcon = GetPvpTalentInfoByID(talentId )
7169+ active, spellId = WeakAuras.CheckPvpTalentBySpellId (index)
7170+ if active and spellId then
7171+ activeName, _ , activeIcon = Private.ExecEnv.GetSpellInfo(spellId )
71647172 end
71657173 end
71667174 ]] ):format (index ))
@@ -7185,7 +7193,7 @@ Private.event_prototypes = {
71857193 if (Private .pvp_talent_types_specific [class ] and Private .pvp_talent_types_specific [class ][spec ]) then
71867194 return Private .pvp_talent_types_specific [class ][spec ];
71877195 else
7188- return Private . pvp_talent_types ;
7196+ return {}
71897197 end
71907198 end ,
71917199 test = " active" ,
0 commit comments