mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-24 00:26:55 +00:00
unitframes: update aggro scan mechanics
This commit is contained in:
+9
-3
@@ -26,8 +26,13 @@ for i=1,40 do pfValidUnits["raidpet" .. i .. "target"] = true end
|
||||
|
||||
local aggrodata = { }
|
||||
function pfUI.api.UnitHasAggro(unit)
|
||||
if UnitExists(unit) and UnitIsFriend(unit, "player") and ( not aggrodata[unit] or GetTime() < aggrodata[unit].check + 1 ) then
|
||||
aggrodata[unit] = { check = GetTime(), state = 0}
|
||||
if aggrodata[unit] and GetTime() > aggrodata[unit].check + 1 then
|
||||
return aggrodata[unit].state
|
||||
end
|
||||
|
||||
aggrodata[unit] = aggrodata[unit] or { check = GetTime(), state = 0}
|
||||
|
||||
if UnitExists(unit) and UnitIsFriend(unit, "player") then
|
||||
for u in pairs(pfValidUnits) do
|
||||
local t = u .. "target"
|
||||
local tt = t .. "target"
|
||||
@@ -36,7 +41,8 @@ function pfUI.api.UnitHasAggro(unit)
|
||||
end
|
||||
end
|
||||
end
|
||||
return aggrodata[unit] and aggrodata[unit].state or 0
|
||||
|
||||
return aggrodata[unit].state
|
||||
end
|
||||
|
||||
pfUI.uf.glow = CreateFrame("Frame")
|
||||
|
||||
Reference in New Issue
Block a user