diff --git a/HideCoA.lua b/HideCoA.lua index 6fd8c36..f6cc7a7 100644 --- a/HideCoA.lua +++ b/HideCoA.lua @@ -45,6 +45,7 @@ local function ShouldHideForClass(playerClass, frameName) end local hookedFrames = {} +local seenNaturalShow = {} local function ApplySetting() @@ -59,6 +60,7 @@ local function ApplySetting() if not hookedFrames[frameName] then frame:HookScript("OnShow", function(self) + seenNaturalShow[frameName] = true local _, currentClass = UnitClass("player") if ShouldHideForClass(currentClass, frameName) then self:Hide() @@ -73,7 +75,12 @@ local function ApplySetting() if hide then frame:Hide() - else + elseif seenNaturalShow[frameName] then + -- The server never Show()s a frame the current class doesn't use, + -- so its data (powerType, maxValue, ...) is never populated. Forcing + -- Show() on it exposes that uninitialized state and crashes the + -- server's own OnUpdate handler. Only force-show a frame we've + -- already seen the game display naturally at least once. frame:Show() end