From e306ecf9a1e53550d48e99776ec865b8afb07907 Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Thu, 11 Apr 2024 20:51:37 +0100 Subject: [PATCH] Update Enemy Character to Stop Setting Alert Level on Sense --- EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp index 1e779bdc..96455cc1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/AI/EnemyCharacter.cpp @@ -60,10 +60,9 @@ void AEnemyCharacter::SetAlertLevel(const int NewAlertLevel) const void AEnemyCharacter::SetLocalAlertLevel(int NewAlertLevel) { if (!IsValid(GetController())) return; - Cast(GetController())->GetBlackboardComponent()->SetValueAsBool("IsInvestigating", true); + if (NewAlertLevel == Cast(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)