Skip to content

Commit 1473358

Browse files
author
LocalIdentity
committed
Fix Crash with MissingManaBeforeEnemyHit code
When using Blood Magic the ManaUnreserved variable is nil so was causing a crash when used in the calculation
1 parent a7a5e90 commit 1473358

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Modules/CalcDefence.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,18 +2567,18 @@ function calcs.buildDefenceEstimations(env, actor)
25672567
poolTable.Life = m_min(poolTable.Life + DamageIn.MissingLifeBeforeEnemyHit * ((output.LifeUnreserved or 0) - poolTable.Life) * (gainMult - 1) / 100, gainMult * output.LifeRecoverable or 0)
25682568
end
25692569
if DamageIn.MissingManaBeforeEnemyHit then
2570-
poolTable.Mana = m_min(poolTable.Mana + DamageIn.MissingManaBeforeEnemyHit * ((output.ManaUnreserved or 0) - poolTable.Mana) * (gainMult - 1) / 100, gainMult * output.ManaUnreserved or 0)
2570+
poolTable.Mana = m_min(poolTable.Mana + DamageIn.MissingManaBeforeEnemyHit * ((output.ManaUnreserved or 0) - poolTable.Mana) * (gainMult - 1) / 100, gainMult * (output.ManaUnreserved or 0))
25712571
end
25722572
if DamageIn.GainWhenHit then
25732573
poolTable.Life = m_min(poolTable.Life + DamageIn.LifeWhenHit * (gainMult - 1), gainMult * (output.LifeRecoverable or 0))
25742574
poolTable.Mana = m_min(poolTable.Mana + DamageIn.ManaWhenHit * (gainMult - 1), gainMult * (output.ManaUnreserved or 0))
25752575
poolTable.EnergyShield = m_min(poolTable.EnergyShield + DamageIn.EnergyShieldWhenHit * (gainMult - 1), gainMult * output.EnergyShieldRecoveryCap)
25762576
end
25772577
end
2578-
if DamageIn.MissingLifeBeforeEnemyHit and poolTable.Mana > 0 then
2578+
if DamageIn.MissingLifeBeforeEnemyHit and poolTable.Life > 0 then
25792579
poolTable.Life = m_min(poolTable.Life + DamageIn.MissingLifeBeforeEnemyHit * ((output.LifeUnreserved or 0) - poolTable.Life) / 100, output.LifeRecoverable or 0)
25802580
end
2581-
if DamageIn.MissingManaBeforeEnemyHit and poolTable.Life > 0 then
2581+
if DamageIn.MissingManaBeforeEnemyHit and poolTable.Mana > 0 then
25822582
poolTable.Mana = m_min(poolTable.Mana + DamageIn.MissingManaBeforeEnemyHit * ((output.ManaUnreserved or 0) - poolTable.Mana) / 100, output.ManaUnreserved or 0)
25832583
end
25842584
poolTable = calcs.reducePoolsByDamage(poolTable, Damage, actor)

0 commit comments

Comments
 (0)