Skip to content

Commit

Permalink
Update Aura.lua to use C_UnitAuras.GetPlayerAuraBySpellID when checki…
Browse files Browse the repository at this point in the history
…ng player auras
  • Loading branch information
CuteOne authored Nov 21, 2024
1 parent de02536 commit 9aceb7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions System/Functions/Aura.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ end
function br.UnitBuffID(unit, spellID, filter)
local spellName = br._G.GetSpellInfo(spellID)
local exactSearch = filter ~= nil and br._G.strfind(br._G.strupper(filter), "EXACT")
if unit == "player" then
local auraInfo = C_UnitAuras.GetPlayerAuraBySpellID(spellID)
if auraInfo and auraInfo.expirationTime > br._G.GetTime() then return true end
end
if exactSearch then
for i = 1, 40 do
local buffName, _, _, _, _, _, _, _, _, buffSpellID = br.UnitBuff(unit, i, "player")
Expand Down Expand Up @@ -81,6 +85,10 @@ function br.UnitDebuffID(unit, spellID, filter)

-- Failsafe if not cached
local exactSearch = filter ~= nil and br._G.strfind(br._G.strupper(filter), "EXACT")
if unit == "player" then
local auraInfo = C_UnitAuras.GetPlayerAuraBySpellID(spellID)
if auraInfo and auraInfo.expirationTime > br._G.GetTime() then return true end
end
if exactSearch then
for i = 1, 40 do
local buffName, _, _, _, _, _, _, _, _, buffSpellID = br._G.UnitDebuff(unit, i, "player")
Expand Down

0 comments on commit 9aceb7e

Please sign in to comment.