(fix/Prototypes) Ignore selected but non-existent talents in the check

Closes #75
Refines the logic for handling missing talents in WeakAuras.CheckTalentByIndex.
Now returns true if a specific talent doesn't exist, but talents are selected.
More a band-aid, but the cleanup function and handling when switching tabs doesn't exist.
This commit is contained in:
NoM0Re
2025-10-13 08:45:35 +02:00
parent 7c7fafe5a8
commit 4648208df0
+8 -1
View File
@@ -566,7 +566,14 @@ function WeakAuras.CheckTalentByIndex(index, extraOption)
local num_talent = (index - 1) % MAX_NUM_TALENTS + 1 local num_talent = (index - 1) % MAX_NUM_TALENTS + 1
local name, _, _, _, rank = GetTalentInfo(tab, num_talent) local name, _, _, _, rank = GetTalentInfo(tab, num_talent)
if name == nil then if name == nil then
return nil if GetTalentInfo(1, 1) == nil then
-- No talents at all, likely to early to grab
return nil
else
-- Talent doesn't exist; ignore it
-- Should be cleared if missing, but struc doesn't exist yet
return true
end
end end
local result = rank and rank > 0 local result = rank and rank > 0
if extraOption == 4 then if extraOption == 4 then