diff --git a/.luacheckrc b/.luacheckrc index a2f1b44..59a012f 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -59,7 +59,6 @@ globals = { 'tinsert', 'UISpecialFrames', 'UnitClass', - 'UnitDebuff', 'UnitExists', 'UnitFactionGroup', 'UnitFullName', diff --git a/Changelog.lua b/Changelog.lua index cb468f0..ad51902 100644 --- a/Changelog.lua +++ b/Changelog.lua @@ -1,6 +1,15 @@ local _, Namespace = ... Namespace.Changelog = { + { + version = '10.2.6-47', + improvements = { + 'Updated TOC for 10.2.6', + }, + bugs = { + 'Fixed a possible Lua error trying to figure out the deserter debuff', + }, + }, { version = '10.2.5-46', improvements = { diff --git a/QueueTools.lua b/QueueTools.lua index 8c39a22..4452644 100644 --- a/QueueTools.lua +++ b/QueueTools.lua @@ -42,7 +42,7 @@ local CharacterPanelCloseSound = SOUNDKIT.IG_CHARACTER_INFO_CLOSE local GetNumGroupMembers = GetNumGroupMembers local GetLFGRoleUpdate = GetLFGRoleUpdate local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo -local UnitDebuff = UnitDebuff +local GetDebuffDataByIndex = C_UnitAuras.GetDebuffDataByIndex local UnitInOtherParty = UnitInOtherParty local GetBattlefieldPortExpiration = GetBattlefieldPortExpiration local GetTime = GetTime @@ -194,10 +194,14 @@ function Private.TriggerDeserterUpdate(data) return end + if not data.units.primary then + return + end + for i = 1, DEBUFF_MAX_DISPLAY do - local _, _, _, _, _, expirationTime, _, _, _, spellId = UnitDebuff(data.units.primary, i) - if spellId == SpellIds.DeserterDebuff then - data.deserterExpiry = expirationTime + local aura = GetDebuffDataByIndex(data.units.primary, i) + if aura and aura.spellId == SpellIds.DeserterDebuff then + data.deserterExpiry = aura.expirationTime return end