From e97d370d23f59f8332f01769607d198af629367e Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Wed, 9 Aug 2023 22:53:32 +0100 Subject: [PATCH] Check if Hit Actor is dead when displaying hitmarker --- Source/Nakatomi/PlayerCharacter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index d488a62..b3552f1 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -342,8 +342,10 @@ void APlayerCharacter::ProcessHits(TArray hits) { healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr, GetController(), this); - - OnEnemyHit.ExecuteIfBound(); + if (!healthComponent->GetIsDead()) + { + OnEnemyHit.ExecuteIfBound(); + } } } }