Update Enemy Character to Stop Setting Alert Level on Sense

This commit is contained in:
Philip W 2024-04-11 20:51:37 +01:00
parent e56c9d39b7
commit e306ecf9a1

View File

@ -60,10 +60,9 @@ void AEnemyCharacter::SetAlertLevel(const int NewAlertLevel) const
void AEnemyCharacter::SetLocalAlertLevel(int NewAlertLevel)
{
if (!IsValid(GetController())) return;
Cast<AAIController>(GetController())->GetBlackboardComponent()->SetValueAsBool("IsInvestigating", true);
if (NewAlertLevel == Cast<AAIController>(GetController())->GetBlackboardComponent()->GetValueAsInt("AlertLevel")) return;
SetAlertLevel(NewAlertLevel);
if (NewAlertLevel >= 2) SetHostilityLevel(EHostilityLevel::Hostile);
if (!IsValid(DelegatedControlHub)) return;
DelegatedControlHub->SetAlertLevel(NewAlertLevel);
}
void AEnemyCharacter::SetHostilityLevel(const EHostilityLevel NewHostilityLevel)