unitframes: optimize memory usage of aggro scanner

This commit is contained in:
shagu
2019-03-17 16:53:20 +01:00
parent 4d373a9164
commit 78ca236fb8
+3 -1
View File
@@ -132,7 +132,9 @@ function pfUI.api.UnitHasAggro(unit)
return aggrodata[unit].state
end
aggrodata[unit] = { check = GetTime(), state = 0}
aggrodata[unit] = aggrodata[unit] or { }
aggrodata[unit].check = GetTime()
aggrodata[unit].state = 0
if UnitExists(unit) and UnitIsFriend(unit, "player") then
for u in pairs(pfValidUnits) do