From a72992c012e53f43bbd76f3a49036aa26cf45d15 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 22 Jan 2018 00:10:28 +0100 Subject: [PATCH] unitframes: extend aggro scanner and fix refresh --- api/unitframes.lua | 9 +++++++-- pfUI.toc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 353e1177..d6f4332a 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -26,7 +26,7 @@ for i=1,40 do pfValidUnits["raidpet" .. i .. "target"] = true end local aggrodata = { } function pfUI.api.UnitHasAggro(unit) - if aggrodata[unit] and GetTime() > aggrodata[unit].check + 1 then + if aggrodata[unit] and GetTime() < aggrodata[unit].check + 1 then return aggrodata[unit].state end @@ -36,7 +36,12 @@ function pfUI.api.UnitHasAggro(unit) for u in pairs(pfValidUnits) do local t = u .. "target" local tt = t .. "target" - if UnitExists(tt) and UnitIsUnit(tt, unit) and UnitCanAttack(t, tt) then + + if UnitExists(t) and UnitIsUnit(t, unit) and UnitCanAttack(u, unit) then + aggrodata[unit].state = aggrodata[unit].state + 1 + end + + if UnitExists(tt) and UnitIsUnit(tt, unit) and UnitCanAttack(t, unit) then aggrodata[unit].state = aggrodata[unit].state + 1 end end diff --git a/pfUI.toc b/pfUI.toc index 3553aad3..ccc27a5b 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccpf|cffffffffUI ## Author: Shagu ## Notes: A complete user interface replacement. -## Version: 3.5.2 +## Version: 3.5.3 ## SavedVariables: pfUI_profiles, pfUI_gold ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB