Bugfix Invalid AI Controller
This commit is contained in:
parent
9e868073f4
commit
52f8aeddb4
@ -77,8 +77,11 @@ void AAICharacter::SetupStimuliSourceComponent()
|
|||||||
void AAICharacter::OnDeath()
|
void AAICharacter::OnDeath()
|
||||||
{
|
{
|
||||||
AAI_EnemyController* AIController = Cast<AAI_EnemyController>(GetController());
|
AAI_EnemyController* AIController = Cast<AAI_EnemyController>(GetController());
|
||||||
|
if (!IsValid(AIController)) return;
|
||||||
UBlackboardComponent* Blackboard = AIController->GetBlackboardComponent();
|
UBlackboardComponent* Blackboard = AIController->GetBlackboardComponent();
|
||||||
|
if (!IsValid(Blackboard)) return;
|
||||||
AEndlessVendettaCharacter* PlayerCharacter = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn());
|
AEndlessVendettaCharacter* PlayerCharacter = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn());
|
||||||
|
if (!IsValid(PlayerCharacter)) return;
|
||||||
if (Blackboard->GetValueAsBool("SeenWithHostilities"))
|
if (Blackboard->GetValueAsBool("SeenWithHostilities"))
|
||||||
{
|
{
|
||||||
PlayerCharacter->DecrementSeenHostileCount();
|
PlayerCharacter->DecrementSeenHostileCount();
|
||||||
|
Loading…
Reference in New Issue
Block a user