CogSample: const and typo fix

This commit is contained in:
Arnaud Jamin
2025-01-25 21:37:29 -05:00
parent 9fecf82663
commit c345235e96
2 changed files with 6 additions and 7 deletions
@@ -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<AActor*> TagretToIgnore;
TArray<AActor*> 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)
+2 -2
View File
@@ -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();