Bugfix Regen Health Whilst Being Taking Damage
This commit is contained in:
parent
dac2f1f708
commit
3721fff015
@ -90,6 +90,7 @@ void AEndlessVendettaCharacter::RegenHealth()
|
||||
Heal(10);
|
||||
if (GetWorld()->GetTimerManager().GetTimerRate(RegenHealthTimerHandle) > 1.0f)
|
||||
{
|
||||
GetWorld()->GetTimerManager().ClearTimer(RegenHealthTimerHandle);
|
||||
GetWorld()->GetTimerManager().SetTimer(RegenHealthTimerHandle, this, &AEndlessVendettaCharacter::RegenHealth, 1.0f, true);
|
||||
}
|
||||
if (CurrentHealth >= MaxHealth) GetWorld()->GetTimerManager().ClearTimer(RegenHealthTimerHandle);
|
||||
@ -207,11 +208,9 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
|
||||
|
||||
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
|
||||
}
|
||||
if (!GetWorld()->GetTimerManager().IsTimerActive(RegenHealthTimerHandle))
|
||||
{
|
||||
|
||||
GetWorld()->GetTimerManager().ClearTimer(RegenHealthTimerHandle);
|
||||
GetWorld()->GetTimerManager().SetTimer(RegenHealthTimerHandle, this, &AEndlessVendettaCharacter::RegenHealth, 5.0f, true);
|
||||
}
|
||||
|
||||
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user