From 999445c78be17e5385514f8055506d75d99fc785 Mon Sep 17 00:00:00 2001 From: shaga <14+shaga@noreply.octowow.st> Date: Tue, 13 Oct 2026 06:34:02 +0000 Subject: [PATCH] Fix totem casts erroring when a totem's cooldown was never read GetTotemDurationAndHealth reads the totem description from tooltip line 5. When that line was empty it returned only duration and health, so the three-value assignment in ScanTotems left the rank's Cooldown nil, and dropping that totem failed in ActivateTotem with "COE_TotemLogic.lua:776: attempt to compare number with nil". - Always return duration, health and cooldown. - When line 5 is empty, read the description from the last tooltip line. It moves up when the tooltip is shorter, e.g. without the "Tools:" line while the totem item is not in the item cache. - Clear line 5 before SetSpell so a shorter tooltip cannot reuse the previous totem's text. --- COE_TotemData.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/COE_TotemData.lua b/COE_TotemData.lua index baa211c..0f6e81d 100644 --- a/COE_TotemData.lua +++ b/COE_TotemData.lua @@ -464,13 +464,26 @@ end -------------------------------------------------------------------]] function COE:GetTotemDurationAndHealth(spellid) + COETotemTTTextLeft5:SetText(nil); COETotemTTTextRight3:SetText(nil); COETotemTT:SetSpell(spellid, BOOKTYPE_SPELL); text = COETotemTTTextLeft5:GetText(); + -- the description is normally line 5 but moves up when the client + -- leaves out the "Tools:" line (totem item not in the item cache). + -- the description is always the last line + -- ----------------------------------------------------------------- + if (not text) then + local last = getglobal("COETotemTTTextLeft" .. COETotemTT:NumLines()); + if (last) then text = last:GetText(); end + end + + -- callers assign all three values: returning fewer leaves the + -- rank's Cooldown nil and the cast errors in ActivateTotem + -- ------------------------------------------------------------ if (not text) then COE:DebugMessage("nil text with id: " .. spellid); - return 0, 0; + return 0, 0, 0; end local duration = 0;