From 4bf0e6b7a9b5669324366bdb753acdd1025c4817 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Sat, 11 May 2024 00:57:18 -0700 Subject: [PATCH] fix: Handle talent tree information for Classic and Cataclysm versions --- Myslot.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Myslot.lua b/Myslot.lua index 504ada2..a762d15 100644 --- a/Myslot.lua +++ b/Myslot.lua @@ -220,9 +220,21 @@ local function GetTalentTreeString() if not ClassTalentFrame_LoadUI then -- maybe classic if GetTalentTabInfo then - return select(3, GetTalentTabInfo(1)) .. - "/" .. select(3, GetTalentTabInfo(2)) .. "/" .. select(3, GetTalentTabInfo(3)) + + if tonumber(select(3, GetTalentTabInfo(1)), 10) then + return select(3, GetTalentTabInfo(1)) .. "/" .. select(3, GetTalentTabInfo(2)) .. "/" .. select(3, GetTalentTabInfo(3)) + end + + -- Cataclysm + + for i = 1, 3 do + if select(8, GetTalentTabInfo(i)) then + return select(2, GetTalentTabInfo(i)) + end + end end + + return nil end ClassTalentFrame_LoadUI()