(fix/threat) unit "At Least One Enemy" due to missing "none" unit

in our game version
This commit is contained in:
NoM0Re
2025-04-21 16:40:02 +02:00
parent 6fc121a17a
commit d3ab7a63a2
2 changed files with 2 additions and 5 deletions
-3
View File
@@ -76,9 +76,6 @@ local ConstructTest, ConstructFunction
local nameplateExists = {} local nameplateExists = {}
---@param unit UnitToken
---@param smart? boolean
---@return boolean unitExists
function WeakAuras.UnitExistsFixed(unit, smart) function WeakAuras.UnitExistsFixed(unit, smart)
if #unit > 9 and unit:sub(1, 9) == "nameplate" then if #unit > 9 and unit:sub(1, 9) == "nameplate" then
return nameplateExists[unit] return nameplateExists[unit]
+2 -2
View File
@@ -6379,7 +6379,7 @@ Private.event_prototypes = {
trigger.unit = trigger.unit or "target"; trigger.unit = trigger.unit or "target";
local ret = [[ local ret = [[
unit = string.lower(unit) unit = string.lower(unit)
local name = UnitName(unit, false) local name = UnitName(unit, false) or (unit == "none" and "Unknown")
local ok = true local ok = true
local aggro, status, threatpct, rawthreatpct, threatvalue, threattotal local aggro, status, threatpct, rawthreatpct, threatvalue, threattotal
if unit and unit ~= "none" then if unit and unit ~= "none" then
@@ -6530,7 +6530,7 @@ Private.event_prototypes = {
}, },
{ {
hidden = true, hidden = true,
test = "WeakAuras.UnitExistsFixed(unit, false) and specificUnitCheck" test = "((WeakAuras.UnitExistsFixed(unit, false) or unit == 'none') and specificUnitCheck)"
} }
}, },
automaticrequired = true automaticrequired = true