diff --git a/.gitignore b/.gitignore index 569ec13..f51f56a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .git .gitea .vscode +*.txt *.zip \ No newline at end of file diff --git a/Modules/PersonalAuras/PersonalAuras.lua b/Modules/PersonalAuras/PersonalAuras.lua index 5df4fad..74a0b2a 100644 --- a/Modules/PersonalAuras/PersonalAuras.lua +++ b/Modules/PersonalAuras/PersonalAuras.lua @@ -151,6 +151,27 @@ local function GetPlayerTrackedDebuff(spellId) return nil end + if AuraUtil and type(AuraUtil.ForEachAura) == "function" then + local foundAura = nil + AuraUtil.ForEachAura("player", "HARMFUL", nil, function(auraData) + if type(auraData) == "table" and tonumber(auraData.spellId) == sid then + foundAura = auraData + return true + end + return false + end, true) + if foundAura and IsAuraDataHarmful(foundAura) then + return { + spellId = sid, + name = tostring(foundAura.name or GetSpellName(sid) or ("Spell " .. tostring(sid))), + icon = foundAura.icon or foundAura.iconFileID or GetSpellIcon(sid), + applications = NormalizeAuraApplications(foundAura), + duration = tonumber(foundAura.duration) or 0, + expirationTime = tonumber(foundAura.expirationTime) or 0, + } + end + end + if C_UnitAuras and type(C_UnitAuras.GetPlayerAuraBySpellID) == "function" then local auraData = C_UnitAuras.GetPlayerAuraBySpellID(sid) if auraData and IsAuraDataHarmful(auraData) then @@ -230,10 +251,7 @@ function PA:AddTrackedDebuff(spellId) if not sid or sid <= 0 then return false, "invalid" end - local name = GetSpellName(sid) - if not name then - return false, "invalid" - end + local name = GetSpellName(sid) or ("Spell " .. tostring(sid)) local settings = self:GetSettings() settings.trackedDebuffs[sid] = true self:Refresh()