Using tags.Methods["threatcolor"](unit) breaks frequently on 10.2.6
arnvid opened this issue ยท 1 comments
Describe the bug
Whenever you target a unit it throws an error. And it blocks oUF frames from updating properly.,
How to reproduce
Any time I call the function with tags.Methods"threatcolor" it throws the following error. But if you call it with
tags.Methods["threatcolor"]("player", unit) it works.
Function in Tags:
['threatcolor'] = [[function(u)
return Hex(GetThreatStatusColor(UnitThreatSituation(u)))
end]],
By checking - UnitThreatSituation(unit) - it always returns nil - and if you call tags.Methods["threatcolor"] with unit, it will always try to call GetThreatStatusColor with nill which does fail.
My current workaround is:
local status = UnitThreatSituation("player", unit)
local color = nil
if (status ~= nil) and (_G.GetNumGroupMembers() > 0 or UnitExists("pet")) then
color = tags.Methods["threatcolor"]("player", unit)
end
What did you expect?
As this code has not changed in RealUI for several years, and not in oUF either - I suspect something changed in Blizzard backend?
Error report
x4 [string "return function(u)..."]:2: Usage: local r, g, b = GetThreatStatusColor(gameErrorIndex)
Stack: [string "=[C]"]: in function 'GetThreatStatusColor'
[string "return function(u)
return Hex(GetThreatStatusColor(UnitThreatSituation(u)))
end"]:2: in function 'threatcolor'
[string "@Interface/AddOns/RealUI_Core-2.3.11/HuD/UnitFrames/Tags.lua"]:210: in function 'f'
[string "@Interface/AddOns/oUF/elements/tags.lua"]:792: in function 'UpdateTag'
[string "@Interface/AddOns/oUF/elements/tags.lua"]:668: in function 'func'
[string "@Interface/AddOns/oUF/ouf.lua"]:200: in function <Interface/AddOns/oUF/ouf.lua:183>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/oUF/ouf.lua"]:218: in function <Interface/AddOns/oUF/ouf.lua:217>
[string "=[C]"]: in function 'Show'
[string "@Interface/FrameXML/SecureStateDriver.lua"]:83: in function <Interface/FrameXML/SecureStateDriver.lua:73>
[string "@Interface/FrameXML/SecureStateDriver.lua"]:137: in function <Interface/FrameXML/SecureStateDriver.lua:119>
Time: 2024/03/20 23:58:46 Index: 4/4
Locals:
(*temporary) = nil
Screenshots