From da1b3e9137302a8d1b25f395ad082cd061eae41b Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 6 Mar 2023 15:37:31 +0000 Subject: [PATCH] Bugfix Null Cached AI References --- .../PlayerTemp/TempCharacter.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index f7c14ed..1358d82 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -39,7 +39,7 @@ void ATempCharacter::BeginPlay() PostProcessVolume = Cast(AllActorsInScene[0]); } Enemy = TEXT("Enemy"); - UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors); + //UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors); Ammo = TEXT("Ammo"); NoiseEmitter = Cast(this->FindComponentByClass(UPawnNoiseEmitterComponent::StaticClass())); } @@ -66,27 +66,27 @@ void ATempCharacter::Sneak() UnCrouch(); isInStealth = false; if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.0f; - for (AActor* Actor : AIActors) - { - USphereComponent* SphereComponent = Actor->FindComponentByClass(); - if (IsValid(SphereComponent)) - { - SphereComponent->SetSphereRadius(40.0f); //default value - } - } + //for (AActor* Actor : AIActors) + //{ + // USphereComponent* SphereComponent = Actor->FindComponentByClass(); + // if (IsValid(SphereComponent)) + // { + // SphereComponent->SetSphereRadius(40.0f); //default value + // } + //} } else { Crouch(); isInStealth = true; - for (AActor* Actor : AIActors) + /*for (AActor* Actor : AIActors) { USphereComponent* SphereComponent = Actor->FindComponentByClass(); if (IsValid(SphereComponent)) { SphereComponent->SetSphereRadius(5.0f); } - } + }*/ if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.8f; } }