CogAbility: Fix cheats not correctly saved when connected to a server

CogSample: Projectile progress
This commit is contained in:
Arnaud Jamin
2023-10-31 23:50:41 -04:00
parent f876862d12
commit 7e8ba3e092
8 changed files with 78 additions and 19 deletions
+17 -1
View File
@@ -4,6 +4,7 @@
#include "CogSampleDefines.h"
#include "CogSampleCharacter.h"
#include "CogSampleLogCategories.h"
#include "CogSampleProjectileComponent.h"
#include "CogSampleTargetAcquisition.h"
#include "GameFramework/PlayerState.h"
#include "Net/UnrealNetwork.h"
@@ -205,7 +206,14 @@ void ACogSamplePlayerController::Server_SetTarget_Implementation(AActor* Value)
}
//--------------------------------------------------------------------------------------------------------------------------
const ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerController(UObject* WorldContextObject)
const ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerControllerConst(UObject* WorldContextObject)
{
const ACogSamplePlayerController* PlayerController = GetFirstLocalPlayerController(WorldContextObject);
return PlayerController;
}
//--------------------------------------------------------------------------------------------------------------------------
ACogSamplePlayerController* ACogSamplePlayerController::GetFirstLocalPlayerController(UObject* WorldContextObject)
{
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull);
if (World == nullptr)
@@ -231,3 +239,11 @@ float ACogSamplePlayerController::GetClientLag() const
return HalfPingInSeconds;
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogSamplePlayerController::Server_ProjectileHit_Implementation(UCogSampleProjectileComponent* Projectile, const FHitResult& HitResult)
{
if (Projectile != nullptr)
{
Projectile->Server_Hit(HitResult);
}
}