Check if Hit Actor is dead when displaying hitmarker

This commit is contained in:
Louis Hobbs 2023-08-09 22:53:32 +01:00
parent 2a33897198
commit e97d370d23
1 changed files with 4 additions and 2 deletions

View File

@ -342,12 +342,14 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits)
{ {
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr, healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
GetController(), this); GetController(), this);
if (!healthComponent->GetIsDead())
{
OnEnemyHit.ExecuteIfBound(); OnEnemyHit.ExecuteIfBound();
} }
} }
} }
} }
}
void APlayerCharacter::OnDamaged() void APlayerCharacter::OnDamaged()
{ {