From 83ecf7bd327a23652401ffd1908235ce296f6d88 Mon Sep 17 00:00:00 2001 From: swrup Date: Fri, 9 Jul 2021 16:17:51 +0000 Subject: [PATCH] fix melee hit_count increment --- common/systems/src/melee.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index 46a3b004fd..20ac8b54a9 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -161,7 +161,7 @@ impl<'a> System<'a> for Sys { char_state: read_data.char_states.get(target), }; - melee_attack.attack.apply_attack( + let is_applied = melee_attack.attack.apply_attack( target_group, attacker_info, target_info, @@ -173,7 +173,9 @@ impl<'a> System<'a> for Sys { |o| outcomes.push(o), ); - melee_attack.hit_count += 1; + if is_applied { + melee_attack.hit_count += 1; + } } } }