Skip to content

Commit

Permalink
Compat code for UnitAura changes
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Jan 16, 2024
1 parent 8321726 commit 2267e9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ read_globals = {
"C_Map",
"C_Scenario",
"C_UIWidgetManager",
"C_UnitAuras",
"CombatLogGetCurrentEventInfo",
"EJ_GetEncounterInfo",
"GetBuildInfo",
Expand Down
24 changes: 19 additions & 5 deletions Transcriptor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1280,15 +1280,22 @@ function sh.CHAT_MSG_RAID_BOSS_EMOTE(msg, npcName, ...)
end

do
local UnitAura = UnitAura
local UnitAura = C_UnitAuras and C_UnitAuras.GetAuraDataByIndex or UnitAura
function sh.UNIT_AURA(unit)
for i = 1, 100 do
local name, _, _, _, duration, _, _, _, _, spellId, _, bossDebuff = UnitAura(unit, i, "HARMFUL")
local name, _, _, _, duration, _, _, _, _, spellId, _, isBossAura = UnitAura(unit, i, "HARMFUL")
if type(name) == "table" then
duration = name.duration
spellId = name.spellId
isBossAura = name.isBossAura
name = name.name
end

if not spellId then
break
elseif not hiddenAuraEngageList[spellId] and not hiddenUnitAuraCollector[spellId] and not PLAYER_SPELL_BLOCKLIST[spellId] then
if UnitIsVisible(unit) then
if bossDebuff then
if isBossAura then
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("BOSS_DEBUFF", spellId, name, duration, unit, UnitName(unit)))
else
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall(spellId, name, duration, unit, UnitName(unit)))
Expand All @@ -1299,12 +1306,19 @@ do
end
end
for i = 1, 100 do
local name, _, _, _, duration, _, _, _, _, spellId, _, bossDebuff = UnitAura(unit, i, "HELPFUL")
local name, _, _, _, duration, _, _, _, _, spellId, _, isBossAura = UnitAura(unit, i, "HELPFUL")
if type(name) == "table" then
duration = name.duration
spellId = name.spellId
isBossAura = name.isBossAura
name = name.name
end

if not spellId then
break
elseif not hiddenAuraEngageList[spellId] and not hiddenUnitAuraCollector[spellId] and not PLAYER_SPELL_BLOCKLIST[spellId] then
if UnitIsVisible(unit) then
if bossDebuff then
if isBossAura then
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("BOSS_BUFF", spellId, name, duration, unit, UnitName(unit)))
else
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall(spellId, name, duration, unit, UnitName(unit)))
Expand Down

0 comments on commit 2267e9e

Please sign in to comment.