Skip to content

Commit

Permalink
Check if Ebon Might table exists before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 27, 2024
1 parent ec826e2 commit 832b162
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
44 changes: 23 additions & 21 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3647,28 +3647,30 @@ function damageClass.PredictedAugSpellsOnEnter(self)

local ebonMightTable = buffUptimeTable[CONST_SPELLID_EBONMIGHT]

--all ebon mights
for i = 1, #ebonMightTable do
local thisEbonMightTable = ebonMightTable[i]
local uptime = thisEbonMightTable[2]
local evokerName = thisEbonMightTable[3]
local targetName = thisEbonMightTable[4]
local targetClass = thisEbonMightTable[5]

local spellName = ebonMightSpellName

if (evokerName) then
targetName = detailsFramework:AddClassColorToText(targetName, targetClass)
targetName = detailsFramework:AddClassIconToText(targetName, targetName, targetClass)
spellName = spellName .. " [" .. targetName .. " ]"
end
if (ebonMightTable) then
--all ebon mights
for i = 1, #ebonMightTable do
local thisEbonMightTable = ebonMightTable[i]
local uptime = thisEbonMightTable[2]
local evokerName = thisEbonMightTable[3]
local targetName = thisEbonMightTable[4]
local targetClass = thisEbonMightTable[5]

local spellName = ebonMightSpellName

if (evokerName) then
targetName = detailsFramework:AddClassColorToText(targetName, targetClass)
targetName = detailsFramework:AddClassIconToText(targetName, targetName, targetClass)
spellName = spellName .. " [" .. targetName .. " ]"
end

local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (uptime > 0) then
local uptimePercent = uptime / combatTime * 100
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. "(" .. format("%.1f", uptimePercent) .. "%)")
GameCooltip:AddIcon(ebonMightSpellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, ebonMightColor)
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (uptime > 0) then
local uptimePercent = uptime / combatTime * 100
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. "(" .. format("%.1f", uptimePercent) .. "%)")
GameCooltip:AddIcon(ebonMightSpellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, ebonMightColor)
end
end
end

Expand Down
6 changes: 6 additions & 0 deletions luaserver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,12 @@ BackdropTemplateMixin = {}
---@field SetThumbTexture fun(self: slider, texture: textureid|texturepath)
---@field SetStepsPerPage fun(self: slider, steps: number)

---get all frames under the cursor that has mouse focus
---@return uiobject[]
function GetMouseFoci()
return {}
end

---@return number
function debugprofilestop() return 0 end

Expand Down

0 comments on commit 832b162

Please sign in to comment.