Skip to content

Commit 4a8f20d

Browse files
Merge pull request #1 from Paliak/issue-208
Fix crash caused by dereference of non existing breakdown table
2 parents 4b36dea + 9d9f774 commit 4a8f20d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Modules/CalcDefence.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,15 @@ function calcs.defence(env, actor)
702702
end
703703
end
704704

705+
if breakdown then
706+
breakdown.Ward = { slots = { } }
707+
breakdown.EnergyShield = { slots = { } }
708+
breakdown.Armour = { slots = { } }
709+
breakdown.Evasion = { slots = { } }
710+
breakdown.Life = { slots = { } }
711+
breakdown.Mana = { slots = { } }
712+
breakdown.Spirit = { slots = { } }
713+
end
705714
if actor == env.minion then
706715
calcs.doActorLifeManaSpirit(env.minion)
707716
calcs.doActorLifeManaSpiritReservation(env.minion)
@@ -847,15 +856,6 @@ function calcs.defence(env, actor)
847856
local energyShield = 0
848857
local armour = 0
849858
local evasion = 0
850-
if breakdown then
851-
breakdown.Ward = { slots = { } }
852-
breakdown.EnergyShield = { slots = { } }
853-
breakdown.Armour = { slots = { } }
854-
breakdown.Evasion = { slots = { } }
855-
breakdown.Life = { slots = { } }
856-
breakdown.Mana = { slots = { } }
857-
breakdown.Spirit = { slots = { } }
858-
end
859859
local energyShieldBase, armourBase, evasionBase, wardBase
860860
local gearWard = 0
861861
local gearEnergyShield = 0

0 commit comments

Comments
 (0)