From 3f0ea09580e445774c8bc7fb6f22fdc9848dd0d3 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 14 Aug 2022 12:35:05 +0200 Subject: [PATCH] unitframes: update predictions on health change --- api/unitframes.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index e0aebd61..fe632add 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -948,11 +948,11 @@ function pfUI.uf.OnUpdate() local unit = this.label .. this.id local heal = libpredict:UnitGetIncomingHeals(unit) local ress = libpredict:UnitHasIncomingResurrection(unit) + local health, maxHealth = UnitHealth(unit), UnitHealthMax(unit) - if heal ~= this.lastheal then + if heal - health - maxHealth ~= this.predictstate then local overhealperc = tonumber(this.config.overhealperc) - local health, maxHealth = UnitHealth(unit), UnitHealthMax(unit) - this.lastheal = heal + this.predictstate = heal - health - maxHealth if heal > 0 and (health < maxHealth or overhealperc > 0 ) then local width = this.config.width