From e5bc1b2d1bfcf5f36bd4f0d567e4ec8e0fb22e85 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 5 Mar 2018 17:43:23 +0100 Subject: Fixes issues I expected Dialyzer to show me. --- src/struct/attack.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/struct/attack.erl') 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 } -- cgit v1.2.3-70-g09d2