From a0b25c79069203af6810d1da857ac6939d80324a Mon Sep 17 00:00:00 2001 From: Pinya <800pin.ru@gmail.com> Date: Wed, 27 Dec 2017 18:48:11 +0300 Subject: [PATCH] why fix global leak --- ElvUI/modules/nameplates/elements/healthBar.lua | 4 ++-- ElvUI/modules/unitframes/unitframes.lua | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ElvUI/modules/nameplates/elements/healthBar.lua b/ElvUI/modules/nameplates/elements/healthBar.lua index f51ce10c2..86e608833 100644 --- a/ElvUI/modules/nameplates/elements/healthBar.lua +++ b/ElvUI/modules/nameplates/elements/healthBar.lua @@ -141,9 +141,9 @@ function mod:ConstructElement_HealthBar(parent) self:StyleFrame(frame) frame:SetScript("OnSizeChanged", function(self, width) - local health = self:GetValue() - local _, maxHealth = self:GetMinMaxValues() if self:GetStatusBarTexture() then + local health = self:GetValue() + local _, maxHealth = self:GetMinMaxValues() self:GetStatusBarTexture():SetPoint("TOPRIGHT", -(width * ((maxHealth - health) / maxHealth)), 0) end end) diff --git a/ElvUI/modules/unitframes/unitframes.lua b/ElvUI/modules/unitframes/unitframes.lua index d822a3094..d7b8d30cf 100644 --- a/ElvUI/modules/unitframes/unitframes.lua +++ b/ElvUI/modules/unitframes/unitframes.lua @@ -898,15 +898,12 @@ function UF:RegisterRaidDebuffIndicator() if ORD then ORD:ResetDebuffData() - local instance = E.global.unitframe.raidDebuffIndicator.instanceFilter - local other = E.global.unitframe.raidDebuffIndicator.otherFilter - instanceSpells = ((E.global.unitframe.aurafilters[instance] and E.global.unitframe.aurafilters[instance].spells) or E.global.unitframe.aurafilters.RaidDebuffs.spells) - otherSpells = ((E.global.unitframe.aurafilters[other] and E.global.unitframe.aurafilters[other].spells) or E.global.unitframe.aurafilters.CCDebuffs.spells) - if instanceType == "party" or instanceType == "raid" then - ORD:RegisterDebuffs(instanceSpells) + local instance = E.global.unitframe.raidDebuffIndicator.instanceFilter + ORD:RegisterDebuffs(E.global.unitframe.aurafilters[instance] and E.global.unitframe.aurafilters[instance].spells or E.global.unitframe.aurafilters.RaidDebuffs.spells) else - ORD:RegisterDebuffs(otherSpells) + local other = E.global.unitframe.raidDebuffIndicator.otherFilter + ORD:RegisterDebuffs(E.global.unitframe.aurafilters[other] and E.global.unitframe.aurafilters[other].spells or E.global.unitframe.aurafilters.CCDebuffs.spells) end end end