Updated to 5.3.x, renamed interface function, and more

In CogSampleSpawnPredictionComponent.cpp, lines 299 through 302 have return statements of FColor::FColor, these have been updated to a single FColor return statement
In CogSampleTargetableInterface.h, the GetTargetLocation function does not compile against Linux. Reason being that it interferes with built in functions that share the same name (notably within the AIController class). This has been changed to GetTargetActorLocation to maintain a similar name. Recommend adding comments when possible.

Additionaly, the sample project and the editor have had their IncludeOrderVersion updated to 5.2. This was done to clear the warning listing that 5.1 will be deprecated in the next major version release.

The project compiles against Windows and Linux (likely other platforms too, unable to check)
Happy to help! :)
This commit is contained in:
Eduardo Valencia
2024-02-15 18:59:25 -05:00
parent 4263047309
commit 7543b49ef7
12 changed files with 38 additions and 41 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ public class CogSampleTarget : TargetRules
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V2;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;
ExtraModuleNames.Add("CogSample");
//bUseUnityBuild = false;
//bUsePCHFiles = false;
+1 -1
View File
@@ -827,7 +827,7 @@ void ACogSampleCharacter::UpdateActiveAbilitySlots()
}
//--------------------------------------------------------------------------------------------------------------------------
FVector ACogSampleCharacter::GetTargetLocation() const
FVector ACogSampleCharacter::GetTargetActorLocation() const
{
return GetActorLocation();
}
+1 -1
View File
@@ -134,7 +134,7 @@ public:
// ICogSampleTargetInterface overrides
//----------------------------------------------------------------------------------------------------------------------
virtual FVector GetTargetLocation() const override;
virtual FVector GetTargetActorLocation() const override;
virtual void GetTargetCapsules(TArray<const UCapsuleComponent*>& Capsules) const override;
@@ -154,7 +154,7 @@ FVector UCogSampleFunctionLibrary_Gameplay::GetActorTargetLocation(const AActor*
if (const ICogSampleTargetableInterface* Targetable = Cast<ICogSampleTargetableInterface>(Actor))
{
return Targetable->GetTargetLocation();
return Targetable->GetTargetActorLocation();
}
return Actor->GetActorLocation();
@@ -296,10 +296,10 @@ FColor UCogSampleSpawnPredictionComponent::GetRoleColor() const
{
switch (Role)
{
case ECogSampleSpawnPredictionRole::Server: return FColor::FColor(255, 0, 0, 255);
case ECogSampleSpawnPredictionRole::Predicted: return FColor::FColor(255, 255, 0, 255);
case ECogSampleSpawnPredictionRole::Replicated: return FColor::FColor(128, 128, 0, 255);
case ECogSampleSpawnPredictionRole::Remote: return FColor::FColor(255, 0, 255, 255);
case ECogSampleSpawnPredictionRole::Server: return FColor(255, 0, 0, 255);
case ECogSampleSpawnPredictionRole::Predicted: return FColor(255, 255, 0, 255);
case ECogSampleSpawnPredictionRole::Replicated: return FColor(128, 128, 0, 255);
case ECogSampleSpawnPredictionRole::Remote: return FColor(255, 0, 255, 255);
}
return FColor(128, 128, 128, 255);
@@ -18,7 +18,7 @@ class ICogSampleTargetableInterface
public:
virtual FVector GetTargetLocation() const { return FVector::ZeroVector; }
virtual FVector GetTargetActorLocation() const { return FVector::ZeroVector; }
virtual void GetTargetCapsules(TArray<const UCapsuleComponent*>& Capsules) const { }
};
+1 -1
View File
@@ -7,7 +7,7 @@ public class CogSampleEditorTarget : TargetRules
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V2;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;
ExtraModuleNames.Add("CogSample");
}
}