Fixes div by 0 error and call to wrong GetSpellInfo
This commit is contained in:
@@ -1025,7 +1025,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown
|
||||
|
||||
for i = 1, #allGeneratorSpells do
|
||||
local thisGenerator = allGeneratorSpells [i]
|
||||
local spellName, _, spellIcon = GetSpellInfo(thisGenerator[1].id)
|
||||
local spellName, _, spellIcon = _GetSpellInfo(thisGenerator[1].id)
|
||||
GameCooltip:AddLine(spellName, FormatTooltipNumber (_, thisGenerator[2]) .. " (|cFFFF5555overflow: " .. FormatTooltipNumber (_, thisGenerator[3]) .. "|r | " .. _cstr ("%.1f", (thisGenerator[2] / allGenerated) * 100).."%)")
|
||||
GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, .1, .9, .1, .9)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
|
||||
@@ -336,10 +336,14 @@ local onEnterSpellBar = function(spellBar, motion) --parei aqui: precisa por nom
|
||||
local normalAverage = spellTable.n_total / math.max(normalHitsAmt, 0.0001)
|
||||
blockLine3.leftText:SetText(Loc ["STRING_AVERAGE"] .. ": " .. Details:CommaValue(normalAverage))
|
||||
|
||||
if (spellTable.n_total > 0) then
|
||||
local tempo = (elapsedTime * spellTable.n_total) / math.max(spellTable.total, 0.001)
|
||||
local normalAveragePercent = spellBar.average / normalAverage * 100
|
||||
local normalTempoPercent = normalAveragePercent * tempo / 100
|
||||
blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(spellTable.n_total / normalTempoPercent))
|
||||
else
|
||||
blockLine3.rightText:SetText(Loc ["STRING_HPS"] .. ": " .. Details:CommaValue(0))
|
||||
end
|
||||
end
|
||||
|
||||
---@type number
|
||||
|
||||
Reference in New Issue
Block a user