Fix totem casts erroring when the item cache is empty
ScanTotems reads each totem's element from the "Tools: <Element> Totem" tooltip line. That line names the totem item, so it stays incomplete until the item is in the client's item cache (WDB). The OctoWoW launcher clears WDB on every launch by default, so the login scan left every element empty and casting any totem failed in SetPendingTotem with "COE_TotemLogic.lua:645: attempt to index field '?' (a nil value)". - Fall back to a table of the English totem names when the tooltip gives no element. - Leave out spells that only have "Totem" in their name and no element (e.g. "Change Appearance: Mark of the Grim Totem"); they were treated as totems and hit the same error even with a warm cache. - SetPendingTotem skips a totem without a known element instead of erroring.
This commit is contained in:
+9
-3
@@ -641,9 +641,15 @@ function COE_Totem:SetPendingTotem(totem, rank)
|
||||
|
||||
-- Set PendingTotems for the given totem element type
|
||||
COE:DebugMessage("SetPendingTotem PendingTotems being set: " ..
|
||||
totem.SpellName .. " with rank: " .. rank);
|
||||
COE.PendingTotems[totem.Element].Totem = totem;
|
||||
COE.PendingTotems[totem.Element].Rank = rank;
|
||||
totem.SpellName .. " with rank: " .. tostring(rank));
|
||||
local pending = COE.PendingTotems[totem.Element];
|
||||
if (not pending) then
|
||||
-- no known element: cast without a timer instead of erroring
|
||||
-- ------------------------------------------------------------
|
||||
return;
|
||||
end
|
||||
pending.Totem = totem;
|
||||
pending.Rank = rank;
|
||||
-- COE.PendingTotems[totem.Element].TimeoutStartMS = GetTime();
|
||||
|
||||
-- get the current lag - Not used but saving if needed
|
||||
|
||||
Reference in New Issue
Block a user