Fix target spotting for spotter

This commit is contained in:
2025-01-01 15:40:29 +01:00
parent c66c961297
commit 2ae12fade0
3 changed files with 7 additions and 4 deletions

View File

@@ -101,9 +101,12 @@ function shared.Spotter.Init()
local frame = CreateFrame("Frame")
frame:RegisterEvent("NAME_PLATE_UNIT_ADDED")
frame:RegisterEvent("TARGET_UNIT_CHANGED")
frame:RegisterEvent("UNIT_TARGET")
frame:SetScript("OnEvent", function(self, event, unit)
if not Heimdall_Data.config.spotter.enabled then return end
if event == "UNIT_TARGET" then
unit = "target"
end
local err = NotifySpotted(unit)
if err then
print(string.format("Error notifying %s: %s", tostring(unit), tostring(err)))