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;