mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 11:50:49 +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 = { }
|
local aggrodata = { }
|
||||||
function pfUI.api.UnitHasAggro(unit)
|
function pfUI.api.UnitHasAggro(unit)
|
||||||
if UnitExists(unit) and UnitIsFriend(unit, "player") and ( not aggrodata[unit] or GetTime() < aggrodata[unit].check + 1 ) then
|
if aggrodata[unit] and GetTime() > aggrodata[unit].check + 1 then
|
||||||
aggrodata[unit] = { check = GetTime(), state = 0}
|
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
|
for u in pairs(pfValidUnits) do
|
||||||
local t = u .. "target"
|
local t = u .. "target"
|
||||||
local tt = t .. "target"
|
local tt = t .. "target"
|
||||||
@@ -36,7 +41,8 @@ function pfUI.api.UnitHasAggro(unit)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return aggrodata[unit] and aggrodata[unit].state or 0
|
|
||||||
|
return aggrodata[unit].state
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.uf.glow = CreateFrame("Frame")
|
pfUI.uf.glow = CreateFrame("Frame")
|
||||||
|
|||||||
Reference in New Issue
Block a user