mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-18 18:40:49 +00:00
unitframes: update predictions on health change
This commit is contained in:
+3
-3
@@ -948,11 +948,11 @@ function pfUI.uf.OnUpdate()
|
|||||||
local unit = this.label .. this.id
|
local unit = this.label .. this.id
|
||||||
local heal = libpredict:UnitGetIncomingHeals(unit)
|
local heal = libpredict:UnitGetIncomingHeals(unit)
|
||||||
local ress = libpredict:UnitHasIncomingResurrection(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 overhealperc = tonumber(this.config.overhealperc)
|
||||||
local health, maxHealth = UnitHealth(unit), UnitHealthMax(unit)
|
this.predictstate = heal - health - maxHealth
|
||||||
this.lastheal = heal
|
|
||||||
|
|
||||||
if heal > 0 and (health < maxHealth or overhealperc > 0 ) then
|
if heal > 0 and (health < maxHealth or overhealperc > 0 ) then
|
||||||
local width = this.config.width
|
local width = this.config.width
|
||||||
|
|||||||
Reference in New Issue
Block a user