From 4648208df08b07555ba3ad64cd47c088ed929b32 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Mon, 13 Oct 2025 08:45:35 +0200 Subject: [PATCH] (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. --- WeakAuras/Prototypes.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 3fda3f8..523ec77 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -566,7 +566,14 @@ function WeakAuras.CheckTalentByIndex(index, extraOption) local num_talent = (index - 1) % MAX_NUM_TALENTS + 1 local name, _, _, _, rank = GetTalentInfo(tab, num_talent) 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 local result = rank and rank > 0 if extraOption == 4 then