summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-03-05 17:43:23 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-03-05 17:43:23 +0100
commite5bc1b2d1bfcf5f36bd4f0d567e4ec8e0fb22e85 (patch)
treee7637ad94f05b7484baa52f3a333af124c6b293a /src/struct/attack.erl
parent9b73f3efa534fa4dfb8ff832550c1914342ddbb9 (diff)
Fixes issues I expected Dialyzer to show me.
Diffstat (limited to 'src/struct/attack.erl')
-rw-r--r--src/struct/attack.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/struct/attack.erl b/src/struct/attack.erl
index b27ff48..7b81adc 100644
--- a/src/struct/attack.erl
+++ b/src/struct/attack.erl
@@ -214,7 +214,7 @@ when
end;
apply_to_healths
(
- {Attack, Effect},
+ Attack,
AttackerHealth,
DefenderHealth
)
@@ -227,14 +227,15 @@ when
and ((Attack#attack.order == first) or (Attack#attack.order == second))
)
) ->
- {_Hits, _Critical, Damage} = Effect,
+ Damage = Attack#attack.damage,
+
case DefenderHealth of
0 ->
{nothing, AttackerHealth, DefenderHealth};
_ ->
{
- {Attack, Effect},
+ Attack,
max(0, (AttackerHealth - Damage)),
DefenderHealth
}