Skip to content

Commit

Permalink
Fix build failure by excluding UnrealEd code from Game builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kmarkindev committed Aug 14, 2023
1 parent 8f882c8 commit 6409659
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Source/Heli/Heli.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ public Heli(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysicsCore" });
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
"PhysicsCore"
});

PrivateDependencyModuleNames.AddRange(new string[] { "EditorScriptingUtilities" });
// Do not include editor-only dependencies for non editor builds
if (Target.Type == TargetType.Editor)
{
PrivateDependencyModuleNames.AddRange(new string[] { "EditorScriptingUtilities" });
}

// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "HelicopterMovementComponent.h"

// Do not include editor-only dependencies for non editor builds
#if WITH_EDITOR
#include "EditorDialogLibrary.h"
#endif

#include "Heli/LogHeli.h"
#include "Kismet/KismetMathLibrary.h"

Expand All @@ -25,6 +29,8 @@ void UHelicopterMovementComponent::BeginPlay()

void UHelicopterMovementComponent::CalculateForceNeededToStartGoingUp() const
{
// Do not include code that depends on editor-only modules for game builds
#if WITH_EDITOR
const float ActualMass = GetActualMass();

const float GravityZ = UHeliConversionsLibrary::CmsToMs(GetGravityZ());
Expand All @@ -45,6 +51,7 @@ void UHelicopterMovementComponent::CalculateForceNeededToStartGoingUp() const
FText::FromString(Result),
EAppMsgType::Ok
);
#endif
}

float UHelicopterMovementComponent::CalculateForceAmountBasedOnCollective() const
Expand Down

0 comments on commit 6409659

Please sign in to comment.