You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix negative eHP and NaN Max hit values for some builds (#9772)
Some builds could show up having negative eHP values or nan max hit when they have single digit life values
numHits could become negative which would make eHP show up as negative too
Enemy damage conversion could also result in max hit becoming 0 in one part of the code and that would then display as NaN after it tries to divide by 0
Co-authored-by: LocalIdentity <localidentity2@gmail.com>
Copy file name to clipboardExpand all lines: src/Modules/CalcDefence.lua
+22-7Lines changed: 22 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2701,7 +2701,10 @@ function calcs.buildDefenceEstimations(env, actor)
2701
2701
ifpoolTable.Life>=0anddamageTotal>=maxDamagethen-- If still living and the amount of damage exceeds maximum threshold we survived infinite number of hits.
2702
2702
returnm_huge
2703
2703
end
2704
-
returnnumHits
2704
+
ifnumHits~=numHitsthen
2705
+
return0
2706
+
end
2707
+
returnm_max(numHits, 0)
2705
2708
end
2706
2709
2707
2710
ifdamageCategoryConfig~="DamageOverTime" then
@@ -3161,9 +3164,12 @@ function calcs.buildDefenceEstimations(env, actor)
0 commit comments