@@ -84,24 +84,33 @@ function br.UnitDebuffID(unit, spellID, filter)
84
84
end
85
85
86
86
-- Failsafe if not cached
87
- local exactSearch = filter ~= nil and br ._G .strfind (br ._G .strupper (filter ), " EXACT" )
88
- if unit == " player" then
89
- local auraInfo = C_UnitAuras .GetPlayerAuraBySpellID (spellID )
87
+ if unit == " player" then
88
+ local auraInfo = C_UnitAuras .GetPlayerAuraBySpellID (spellID )
90
89
if auraInfo and auraInfo .expirationTime > br ._G .GetTime () then return auraInfo end
91
90
end
91
+ local exactSearch = filter ~= nil and br ._G .strfind (br ._G .strupper (filter ), " EXACT" )
92
92
if exactSearch then
93
93
for i = 1 , 40 do
94
- local buffName , _ , _ , _ , _ , _ , _ , _ , _ , buffSpellID = br ._G .UnitDebuff (unit , i , " player" )
95
- if buffName == nil then return nil end
96
- if buffSpellID == spellID then
97
- return br ._G .UnitDebuff (unit , i , " player" )
94
+ -- local buffName, _, _, _, _, _, _, _, _, buffSpellID = br._G.UnitDebuff(unit, i, "player")
95
+ local auraInfo = C_UnitAuras .GetDebuffDataByIndex (unit , i , " PLAYER" )
96
+ if auraInfo == nil then return nil end
97
+ if auraInfo .spellId == spellID then
98
+ return auraInfo -- br._G.UnitDebuff(unit, i, "player")
98
99
end
99
100
end
100
101
else
101
102
if filter ~= nil and br ._G .strfind (br ._G .strupper (filter ), " PLAYER" ) then
102
- return br ._G .AuraUtil .FindAuraByName (spellName , unit , " HARMFUL|PLAYER" )
103
+ for i = 1 , 40 do
104
+ local auraInfo = C_UnitAuras .GetDebuffDataByIndex (unit , i , " HARMFUL|PLAYER" )
105
+ if auraInfo and auraInfo .name == spellName then return auraInfo end
106
+ end
107
+ -- return br._G.AuraUtil.FindAuraByName(spellName, unit, "HARMFUL|PLAYER")
108
+ end
109
+ for i = 1 , 40 do
110
+ local auraInfo = C_UnitAuras .GetDebuffDataByIndex (unit , i , " HARMFUL" )
111
+ if auraInfo and auraInfo .name == spellName then return auraInfo end
103
112
end
104
- return br ._G .AuraUtil .FindAuraByName (spellName , unit , " HARMFUL" )
113
+ -- return br._G.AuraUtil.FindAuraByName(spellName, unit, "HARMFUL")
105
114
end
106
115
end
107
116
0 commit comments