From c345235e96647b6f4a062c4f425a4a9e7cc948d6 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Sat, 25 Jan 2025 21:37:29 -0500 Subject: [PATCH] CogSample: const and typo fix --- Source/CogSample/CogSamplePlayerController.cpp | 9 ++++----- Source/CogSample/CogSamplePlayerController.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/CogSample/CogSamplePlayerController.cpp b/Source/CogSample/CogSamplePlayerController.cpp index e905271..a7fb805 100644 --- a/Source/CogSample/CogSamplePlayerController.cpp +++ b/Source/CogSample/CogSamplePlayerController.cpp @@ -7,7 +7,6 @@ #include "CogSampleProjectileComponent.h" #include "CogSampleTargetAcquisition.h" #include "GameFramework/PlayerState.h" -#include "Net/UnrealNetwork.h" #if ENABLE_COG #include "CogAbilityReplicator.h" @@ -164,9 +163,9 @@ void ACogSamplePlayerController::TickTargeting(float DeltaSeconds) return; } - TArray TagretToIgnore; + TArray TargetToIgnore; FCogSampleTargetAcquisitionResult Result; - TargetAcquisition->FindBestTarget(this, TagretToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result); + TargetAcquisition->FindBestTarget(this, TargetToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result); SetTarget(Result.Target); } @@ -205,14 +204,14 @@ void ACogSamplePlayerController::Server_SetTarget_Implementation(AActor* Value) } //-------------------------------------------------------------------------------------------------------------------------- -const ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerControllerConst(UObject* WorldContextObject) +const ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerControllerConst(const UObject* WorldContextObject) { const ACogSamplePlayerController* PlayerController = GetFirstLocalPlayerController(WorldContextObject); return PlayerController; } //-------------------------------------------------------------------------------------------------------------------------- -ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerController(UObject* WorldContextObject) +ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerController(const UObject* WorldContextObject) { UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull); if (World == nullptr) diff --git a/Source/CogSample/CogSamplePlayerController.h b/Source/CogSample/CogSamplePlayerController.h index b6f54a4..e4ebd35 100644 --- a/Source/CogSample/CogSamplePlayerController.h +++ b/Source/CogSample/CogSamplePlayerController.h @@ -25,9 +25,9 @@ class ACogSamplePlayerController public: - static const ACogSamplePlayerController* GetFirstLocalPlayerControllerConst(UObject* WorldContextObject); + static const ACogSamplePlayerController* GetFirstLocalPlayerControllerConst(const UObject* WorldContextObject); - static ACogSamplePlayerController* GetFirstLocalPlayerController(UObject* WorldContextObject); + static ACogSamplePlayerController* GetFirstLocalPlayerController(const UObject* WorldContextObject); ACogSamplePlayerController();