Skip to content

Commit

Permalink
Fixed a possible Lua error trying to figure out the deserter debuff
Browse files Browse the repository at this point in the history
  • Loading branch information
linaori committed Mar 18, 2024
1 parent 2a12351 commit aa4b029
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 0 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ globals = {
'tinsert',
'UISpecialFrames',
'UnitClass',
'UnitDebuff',
'UnitExists',
'UnitFactionGroup',
'UnitFullName',
Expand Down
9 changes: 9 additions & 0 deletions Changelog.lua
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
12 changes: 8 additions & 4 deletions QueueTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aa4b029

Please sign in to comment.