Skip to content

Commit

Permalink
Update ElvUI_Extras.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
noname08662 authored Jan 11, 2025
1 parent 24384bd commit 506bdc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ElvUI_Extras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,15 @@ function core:Tag(name, tagfunc, updatefunc)
self:SecureHook(frame, "UpdateAllElements", function(frame, event)
if not wrongEvents[event] and frame.unit then
local guid = UnitGUID(frame.unit)
if guid ~= frame.lastGUID then
if guid and guid ~= frame.lastGUID then
for _, updateFunc in pairs(nameUpdates) do
updateFunc(_, frame, frame.unit)
end
frame.lastGUID = guid
end
end
end)
self:SecureHookScript(frame, "OnHide", function(self) self.lastGUID = nil end)
if frameType == 'target' or frameType == 'focus' then
frame:RegisterEvent(format("PLAYER_%s_CHANGED", upper(frameType)), frame.UpdateAllElements)
end
Expand All @@ -1055,14 +1056,15 @@ function core:Tag(name, tagfunc, updatefunc)
core:SecureHook(frame, "UpdateAllElements", function(frame, event)
if not wrongEvents[event] and frame.unit then
local guid = UnitGUID(frame.unit)
if guid ~= frame.lastGUID then
if guid and guid ~= frame.lastGUID then
for _, updateFunc in pairs(nameUpdates) do
updateFunc(_, frame, frame.unit)
end
frame.lastGUID = guid
end
end
end)
core:SecureHookScript(frame, "OnHide", function(self) self.lastGUID = nil end)
if unitframeType == 'target' or unitframeType == 'focus' then
frame:RegisterEvent(format("PLAYER_%s_CHANGED", upper(frameType)), frame.UpdateAllElements)
end
Expand Down

0 comments on commit 506bdc6

Please sign in to comment.