Skip to content

Commit 48d4e43

Browse files
committed
Manually iterate again but use UnitAura for cata support.
1 parent 95da0f2 commit 48d4e43

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

MagicTargets.lua

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ local DBOpt = LibStub("AceDBOptions-3.0")
4040
local media = LibStub("LibSharedMedia-3.0")
4141
local mod = MagicTargets
4242
local comm = LibStub("MagicComm-1.0")
43-
43+
local UnitAura = UnitAura
4444
local CreateFrame = CreateFrame
4545
local GetInventoryItemLink = GetInventoryItemLink
4646
local GetItemInfo = GetItemInfo
@@ -397,9 +397,9 @@ do
397397
end
398398
local _, class = UnitClass(unit)
399399
local auras = tankAura[class]
400-
-- if mod.debug then mod:debug("Tank check: Class = %s,auras = %s, type(auras) = %s",
401-
-- class, mod:Dump(auras), type(auras))
402-
-- end
400+
-- if mod.debug then mod:debug("Tank check: Class = %s,auras = %s, type(auras) = %s",
401+
-- class, mod:Dump(auras), type(auras))
402+
-- end
403403
if not auras then
404404
-- mod:debug("Found no auras for class %s", class)
405405
unitTanks[name] = false
@@ -408,11 +408,17 @@ do
408408

409409
if type(auras) == "function" then
410410
unitTanks[name] = auras(unit)
411-
-- mod:debug("Found that %s [%s] is %s", name, unit, tostring(auras(unit)))
411+
--mod:debug("Found that %s [%s] is %s", name, unit, tostring(auras(unit)))
412412
return unitTanks[name]
413413
else
414-
for aura in pairs(auras) do
415-
if AuraUtil.FindAuraByName(unit, aura) then
414+
for idx = 1, 40 do
415+
local aura = UnitAura(unit, idx, "HELPFUL")
416+
if not aura then
417+
break
418+
end
419+
-- mod:debug("Scanning: Found %s ", mod:Dump(aura) or "nil")
420+
421+
if auras[aura] then
416422
unitTanks[name] = true
417423
return true
418424
end

0 commit comments

Comments
 (0)