Skip to content

Commit 6f009a3

Browse files
author
LocalIdentity
committed
Fix crash when output.DamageRolls is nil
Fixes #8731
1 parent ce50924 commit 6f009a3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/Modules/CalcOffence.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,18 +3390,19 @@ function calcs.offence(env, actor, activeSkill)
33903390
if breakdown then
33913391
if output.CritEffect ~= 1 then
33923392
breakdown.AverageHit = { }
3393-
local rolls = m_abs(output.DamageRolls) + 2
3394-
if output.DamageRolls > 0 then
3393+
local damageRolls = output.DamageRolls or 0
3394+
local rolls = m_abs(damageRolls) + 2
3395+
if damageRolls > 0 then
33953396
t_insert(breakdown.AverageHit, s_format("(1/%d) x %d + (%d/%d) x %d = %.1f ^8(average from non-crits)", rolls, totalHitMin, rolls - 1, rolls, totalHitMax, totalHitAvg))
33963397
end
3397-
if output.DamageRolls < 0 then
3398+
if damageRolls < 0 then
33983399
t_insert(breakdown.AverageHit, s_format("(%d/%d) x %d + (1/%d) x %d = %.1f ^8(average from non-crits)", rolls - 1, rolls, totalHitMin, rolls, totalHitMax, totalHitAvg))
33993400
end
3400-
if output.DamageRolls > 0 or skillModList:Flag(skillCfg, "CritLucky") then
3401+
if damageRolls > 0 or skillModList:Flag(skillCfg, "CritLucky") then
34013402
t_insert(breakdown.AverageHit, s_format("(1/%d) x %d + (%d/%d) x %d = %.1f ^8(average from crits)", rolls, totalCritMin, rolls - 1, rolls, totalCritMax, totalCritAvg))
34023403
t_insert(breakdown.AverageHit, "")
34033404
end
3404-
if output.DamageRolls < 0 and not skillModList:Flag(skillCfg, "CritLucky") then
3405+
if damageRolls < 0 and not skillModList:Flag(skillCfg, "CritLucky") then
34053406
t_insert(breakdown.AverageHit, s_format("(%d/%d) x %d + (1/%d) x %d = %.1f ^8(average from crits)", rolls - 1, rolls, totalCritMin, rolls, totalCritMax, totalCritAvg))
34063407
t_insert(breakdown.AverageHit, "")
34073408
end

0 commit comments

Comments
 (0)