From 531f79b5765aa554029602fa74d926e49f69615e Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 8 Sep 2017 19:02:16 +0200 Subject: [PATCH] unitframes: never abort range checks without cache --- api/unitframes.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index c0175f0d..e5487971 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -270,9 +270,6 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) end if UnitIsConnected(this.label .. this.id) or ( pfUI.unlock and pfUI.unlock:IsShown()) then - if not this.cache then return end - if not this.cache.hp or not this.cache.power then return end - if this.config.faderange == "1" then if pfUI.api.UnitInRange(this.label .. this.id, 4) or (pfUI.unlock and pfUI.unlock:IsShown()) then if this:GetAlpha() ~= 1 then @@ -291,6 +288,9 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) end end + if not this.cache then return end + if not this.cache.hp or not this.cache.power then return end + local hpDisplay = this.hp.bar:GetValue() local hpReal = this.cache.hp local hpDiff = abs(hpReal - hpDisplay)