Bugfix Unable to Escape in Some Situations
This commit is contained in:
parent
5634557af2
commit
37268a3dc2
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/AIBruh.uasset
(Stored with Git LFS)
Binary file not shown.
@ -2,7 +2,10 @@
|
||||
|
||||
|
||||
#include "HoldToInitCombat.h"
|
||||
|
||||
#include "AIController.h"
|
||||
#include "TurnBaseCombatV2.h"
|
||||
#include "BehaviorTree/BlackboardComponent.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
|
||||
|
||||
@ -70,7 +73,12 @@ void UHoldToInitCombat::OnClickDown()
|
||||
if (AActor* ClickHit = LookingAtEnemy(); ClickHit != nullptr)
|
||||
{
|
||||
TargetEnemy = ClickHit;
|
||||
Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->StartCombat(TargetEnemy);
|
||||
EnemyBlackboard = Cast<AAIController>(TargetEnemy->GetInstigatorController())->GetBlackboardComponent();
|
||||
if (!EnemyBlackboard->GetValueAsBool("WasInCombat"))
|
||||
{
|
||||
Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->StartCombat(TargetEnemy);
|
||||
return;
|
||||
}
|
||||
InitCombatWidget->SetVisibility(ESlateVisibility::Hidden);
|
||||
return;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "NiagaraFunctionLibrary.h"
|
||||
#include "Components/RadialSlider.h"
|
||||
#include "BehaviorTree/BlackboardComponent.h"
|
||||
#include "HoldToInitCombat.generated.h"
|
||||
|
||||
class UNiagaraSystem;
|
||||
@ -35,6 +36,8 @@ public:
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
UPROPERTY()
|
||||
UBlackboardComponent* EnemyBlackboard;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
|
Loading…
Reference in New Issue
Block a user