summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/struct/shr_omnimods.erl')
-rw-r--r--src/shared/struct/shr_omnimods.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/struct/shr_omnimods.erl b/src/shared/struct/shr_omnimods.erl
index 31d61f2..f0ccdc5 100644
--- a/src/shared/struct/shr_omnimods.erl
+++ b/src/shared/struct/shr_omnimods.erl
@@ -197,8 +197,9 @@ get_attack_damage (AttackModifier, AttackerOmnimods, DefenderOmnimods) ->
dict:fold
(
fun (Name, BaseDmg, CurrentResult) ->
+ NormDmg = max(0, BaseDmg),
ModifiedDmg =
- (shr_math_util:ceil(BaseDmg * AttackModifier) - BaseDefense),
+ (shr_math_util:ceil(NormDmg * AttackModifier) - BaseDefense),
case dict:find(Name, DefenderOmnimodsDefmods) of
{ok, Def} when (Def >= ModifiedDmg) -> CurrentResult;
{ok, Def} -> (CurrentResult + (ModifiedDmg - Def));