#if WITH_EDITOR protection creates error while packaging

Hello there,

In my EQS code, I have used the #if WITH_EDITOR to exclude variables and code that I use for debugging in the editor, but do not want in the packaged game. When building/compiling my code in editor everything works, but not when I package my project. I guess I do something wrong, as all my debug variables create errors.

They all create errors like this:

ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): error C2039: 'DebugDrawTime': is not a member of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryTest_CoverDirection.h(14): note: see declaration of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition

And here the files that hold this debug variable:

EnvQueryTest_CoverDirection.h:

// Copyright by Felix Voigt

#pragma once

#include "CoreMinimal.h"
#include "EnvironmentQuery/EnvQueryTest.h"
#include "EnvQueryTest_CoverDirection.generated.h"

/**
 * This test checks for the direction towards context actors
 */

UCLASS()
class HARRISONPROJECT_API UEnvQueryTest_CoverDirection : public UEnvQueryTest
{
	GENERATED_UCLASS_BODY()

#if WITH_EDITOR

	/*Visualize Debug information*/
	UPROPERTY(EditDefaultsOnly, Category = Debug)
	FAIDataProviderBoolValue DebugMode;

	/*How long the Debug stuff should be drawn*/
	UPROPERTY(EditDefaultsOnly, Category = Debug)
	FAIDataProviderFloatValue DebugDrawTime;

#endif //WITH_EDITOR

	/** context */
	UPROPERTY(EditDefaultsOnly, Category = CoverDirection)
	TSubclassOf<UEnvQueryContext> AngleTo;

	virtual void RunTest(FEnvQueryInstance& QueryInstance) const override;

	virtual FText GetDescriptionTitle() const override;
	virtual FText GetDescriptionDetails() const override;
	
};

EnvQueryTest_CoverDirection.cpp:

// Copyright by Felix Voigt


#include "EnvQueryTest_CoverDirection.h"
#include "EnvQueryItemType_CoverPoint.h"
#include "DrawDebugHelpers.h"

#define ENVQUERYTEST_COVER_DIRECTION_NAN_DETECTION 1

namespace
{
	FORCEINLINE void CheckContextLocationForNaN(const FVector& ContextLocation, UObject* QueryOwner, int32 Index)
	{
#if ENVQUERYTEST_COVER_DIRECTION_NAN_DETECTION
		ensureMsgf(!ContextLocation.ContainsNaN(), TEXT("EnvQueryTest_CoverDirection NaN in ContextLocations with owner %s. X=%f,Y=%f,Z=%f. Index:%d"), *GetPathNameSafe(QueryOwner), ContextLocation.X, ContextLocation.Y, ContextLocation.Z, Index);
#endif
	}
}


UEnvQueryTest_CoverDirection::UEnvQueryTest_CoverDirection(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
	Cost = EEnvTestCost::Low;
	ValidItemType = UEnvQueryItemType_CoverPoint::StaticClass();

	AngleTo = UEnvQueryContext::StaticClass();

#if WITH_EDITOR

	DebugMode.DefaultValue = false;
	DebugDrawTime.DefaultValue = 5.0f;

#endif //WITH_EDITOR
}

void UEnvQueryTest_CoverDirection::RunTest(FEnvQueryInstance& QueryInstance) const
{
	//safetythings
	UObject* QueryOwner = QueryInstance.Owner.Get();
	if (QueryOwner == nullptr)
	{
		return;
	}

	FloatValueMin.BindData(QueryOwner, QueryInstance.QueryID);
	float MinThresholdValue = FloatValueMin.GetValue();

	FloatValueMax.BindData(QueryOwner, QueryInstance.QueryID);
	float MaxThresholdValue = FloatValueMax.GetValue();

	// don't support context Item here, it doesn't make any sense
	TArray<FVector> ContextLocations;
	if (!QueryInstance.PrepareContext(AngleTo, ContextLocations))
	{
		return;
	}

	for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
	{
		FRotator TempRot = GetItemRotation(QueryInstance, It.GetIndex());
		FVector CoverDirection = FVector(TempRot.Pitch, TempRot.Yaw, TempRot.Roll);
		CoverDirection.Z = 0.0f;
		float ScoreFinal = 1.0f;


		//This should happen for all context objects
		for (int32 ContextIndex = 0; ContextIndex < ContextLocations.Num(); ContextIndex++)
		{
			CheckContextLocationForNaN(ContextLocations[ContextIndex], QueryOwner, ContextIndex);
			//CoverDirection should optimally align with the vector toward the threat
			FVector ThreatDirection = (ContextLocations[ContextIndex] - GetItemLocation(QueryInstance, It.GetIndex())).GetSafeNormal2D();

			float ScoreTest = FMath::Clamp(CoverDirection.CosineAngle2D(ThreatDirection), 0.0f, 1.0f);
			
			//Assign lowest rating for the final sorting value.

			ScoreFinal = ScoreTest < ScoreFinal ? ScoreTest : ScoreFinal;

#if WITH_EDITOR

			if (DebugMode.GetValue() == true && ScoreFinal > 0.0f)
			{
				//draw point cover direction
				DrawDebugLine(
					GetWorld(),
					GetItemLocation(QueryInstance, It.GetIndex()) + FVector(0, 0, 50.0f),
					GetItemLocation(QueryInstance, It.GetIndex()) + FVector(0, 0, 50.0f) + CoverDirection * 100.0f,
					FColor(0, 255, 0),
					false,
					DebugDrawTime.GetValue(),
					0,
					3
				);

				//correction hit
				DrawDebugLine(
					GetWorld(),
					GetItemLocation(QueryInstance, It.GetIndex()) + FVector(0, 0, 50.0f),
					GetItemLocation(QueryInstance, It.GetIndex()) + FVector(0, 0, 50.0f) + ThreatDirection * 100.0f,
					FColor(255, 0, 0),
					false,
					DebugDrawTime.GetValue(),
					0,
					3
				);
			}
			
#endif //WITH_EDITOR

		}
		
		It.SetScore(TestPurpose, FilterType, ScoreFinal, MinThresholdValue, MaxThresholdValue);
	}
}

FText UEnvQueryTest_CoverDirection::GetDescriptionTitle() const
{
	return Super::GetDescriptionTitle();
}

FText UEnvQueryTest_CoverDirection::GetDescriptionDetails() const
{
	return DescribeFloatTestParams();
}

My complete Error Log, also available as .txt:

WindowsPlatformFactory.RegisterBuildPlatforms: UnrealBuildTool.WindowsPlatformSDK using manually installed SDK
BuildMode.Execute: Command line: "D:\Programs\Unreal Engine\UE_4.23\Engine\Binaries\DotNET\UnrealBuildTool.exe" HarrisonProject Win64 Development -Project=D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\HarrisonProject.uproject  D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\HarrisonProject.uproject -NoUBTMakefiles  -remoteini="D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject" -skipdeploy -Manifest=D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Manifest.xml -NoHotReload -log="C:\Users\chlai\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+Programs+Unreal+Engine+UE_4.23\UBT-HarrisonProject-Win64-Development.txt"
WindowsPlatform.FindVSInstallDirs: Found Visual Studio installation: D:\Programs\Microsoft Visual Studio\2017\Community (Product=Microsoft.VisualStudio.Product.Community, Version=15.9.28307.1000, Sort=0)
WindowsPlatform.FindToolChainDirs: Found Visual Studio toolchain: D:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023 (Version=14.16.27023)
WindowsPlatform.UpdateCachedWindowsSdks: Found Windows 8.1 SDK at C:\Program Files (x86)\Windows Kits\8.1
WindowsPlatform.EnumerateSdkRootDirs: Found Windows 10 SDK root at D:\Windows Kits\10 (1)
WindowsPlatform.EnumerateSdkRootDirs: Found Windows 10 SDK root at D:\Windows Kits\10 (2)
WindowsPlatform.UpdateCachedWindowsSdks: Found Universal CRT version 10.0.10240.0 at D:\Windows Kits\10
UEBuildTarget.AddPlugin: Enabling plugin 'DlgSystem' (referenced via HarrisonProject.uproject)
UEBuildTarget.AddPlugin: Enabling plugin 'Paper2D' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AISupport' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LightPropagationVolume' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ActorLayerUtilities' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AnimationSharing' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SignificanceManager' (referenced via default plugins -> AnimationSharing.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'CLionSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CodeLiteSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GitSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'KDevelopSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NullSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PerforceSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SubversionSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'UObjectPlugin' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VisualStudioCodeSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VisualStudioSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'XCodeSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AssetManagerEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CryptoKeys' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CurveEditorTools' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'DataValidation' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'FacialAnimation' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GameplayTagsEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MacGraphicsSwitching' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MaterialAnalyzer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MobileLauncherProfileWizard' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PluginBrowser' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SpeedTreeImporter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'DatasmithContent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VariantManagerContent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AlembicImporter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GeometryCache' (referenced via default plugins -> AlembicImporter.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'AutomationUtils' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ScreenshotTools' (referenced via default plugins -> AutomationUtils.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'BackChannel' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CharacterAI' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'HTML5Networking' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PlatformCrypto' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ProxyLODPlugin' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SkeletalReduction' (referenced via default plugins)
UEBuildTarget.AddPlugin: Ignoring plugin 'MagicLeapMedia' (referenced via default plugins) due to unsupported target platform.
UEBuildTarget.AddPlugin: Ignoring plugin 'MagicLeap' (referenced via default plugins) due to unsupported target platform.
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AvfMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ImgMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MediaCompositing' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MediaPlayerEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WmfMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'TcpMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'UdpMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ActorSequence' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LevelSequenceEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MatineeToLevelSequence' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NetcodeUnitTest' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NUTUnrealEngine4' (referenced via default plugins)
UEBuildTarget.AddPlugin: Ignoring plugin 'OnlineSubsystemGooglePlay' (referenced via default plugins) due to unsupported target platform.
UEBuildTarget.AddPlugin: Ignoring plugin 'OnlineSubsystemIOS' (referenced via default plugins) due to unsupported target platform.
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemNull' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystem' (referenced via default plugins -> OnlineSubsystemNull.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemUtils' (referenced via default plugins -> OnlineSubsystemNull.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'LauncherChunkInstaller' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidPermission' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AppleImageUtils' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AppleMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ArchVisCharacter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AudioCapture' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CableComponent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CustomMeshComponent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'EditableMesh' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ExampleDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GoogleCloudMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'IOSDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LinuxDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LocationServicesBPLibrary' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MobilePatchingUtils' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OculusVR' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ProceduralMeshComponent' (referenced via default plugins -> OculusVR.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'PhysXVehicles' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'RuntimePhysXCooking' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SteamVR' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WebMMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WebMMedia' (referenced via default plugins -> WebMMoviePlayer.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'WindowsMoviePlayer' (referenced via default plugins)
VCToolChain..ctor: Compiler: D:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe
VCToolChain..ctor: Linker: D:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe
VCToolChain..ctor: Library Manager: D:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\lib.exe
VCToolChain..ctor: Resource Compiler: C:\Program Files (x86)\Windows Kits\8.1\bin\x64\rc.exe
ExternalExecution.ExecuteHeaderToolIfNecessary: Parsing headers for HarrisonProject
ExternalExecution.ExecuteHeaderToolIfNecessary:   Running UnrealHeaderTool "D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\HarrisonProject.uproject" "D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\HarrisonProject\Development\HarrisonProject.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
ExternalExecution.ExecuteHeaderToolIfNecessary: Reflection code generated for HarrisonProject in 5,2758378 seconds
UEBuildTarget.GenerateManifest: Writing manifest to D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Manifest.xml
HotReload.IsLiveCodingSessionActive: Checking for live coding mutex: Global\LiveCoding_D++Projects+HarrisonProject_FelixVoigt_BinaerBoy_01+HarrisonProject+Binaries+Win64+HarrisonProject.exe
ActionGraph.IsActionOutdated: EnvQueryGenerator_Cover.gen.cpp: Produced item "EnvQueryGenerator_Cover.gen.cpp.obj" doesn't exist.
ActionGraph.IsActionOutdated: EnvQueryGenerator_Cover.gen.cpp: Produced item "EnvQueryGenerator_Cover.gen.cpp.txt" doesn't exist.
ActionGraph.IsActionOutdated: EnvQueryGenerator_Cover.cpp: Produced item "EnvQueryGenerator_Cover.cpp.obj" doesn't exist.
ActionGraph.IsActionOutdated: EnvQueryGenerator_Cover.cpp: Produced item "EnvQueryGenerator_Cover.cpp.txt" doesn't exist.
ActionGraph.IsActionOutdated: HarrisonProject.exe: Produced item "HarrisonProject.pdb" doesn't exist.
ActionGraph.IsActionOutdated: EnvQueryTest_CoverDirection.gen.cpp: Produced item "EnvQueryTest_CoverDirection.gen.cpp.txt" doesn't exist.
ActionGraph.IsActionOutdated: HarrisonProject.exe: Produced item "HarrisonProject.pdb" doesn't exist.
ActionGraph.IsActionOutdated: HarrisonProject.target: Prerequisite HarrisonProject.exe is produced by outdated action.
BuildMode.Build: Using Visual Studio 2017 14.16.27023 toolchain (D:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 8.1 SDK (C:\Program Files (x86)\Windows Kits\8.1).
ParallelExecutor.ExecuteActions: Building 5 actions with 8 processes...
ParallelExecutor.ExecuteActions:   [1/5] EnvQueryTest_CoverDirection.gen.cpp
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): error C2039: 'DebugDrawTime': is not a member of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryTest_CoverDirection.h(14): note: see declaration of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(83): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(92): error C2039: 'DebugMode': is not a member of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryTest_CoverDirection.h(14): note: see declaration of 'UEnvQueryTest_CoverDirection'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(92): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryTest_CoverDirection.gen.cpp(92): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   [2/5] EnvQueryGenerator_Cover.gen.cpp
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(119): error C2039: 'CoverCorrection': is not a member of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryGenerator_Cover.h(19): note: see declaration of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(119): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(119): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(128): error C2039: 'ShowDebugCoverPoints': is not a member of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryGenerator_Cover.h(19): note: see declaration of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(128): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(128): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(137): error C2039: 'ShowDebugEdges': is not a member of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryGenerator_Cover.h(19): note: see declaration of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(137): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(137): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(146): error C2039: 'DebugDrawTime': is not a member of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryGenerator_Cover.h(19): note: see declaration of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(146): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(146): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(155): error C2039: 'DebugMode': is not a member of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Source\HarrisonProject/Public/AI/EQS/EnvQueryGenerator_Cover.h(19): note: see declaration of 'UEnvQueryGenerator_Cover'
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(155): error C2618: illegal member designator in offsetof
ParallelExecutor.ExecuteActions:   D:\Projects\HarrisonProject_FelixVoigt_BinaerBoy_01\HarrisonProject\Intermediate\Build\Win64\UE4\Inc\HarrisonProject\EnvQueryGenerator_Cover.gen.cpp(155): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
ParallelExecutor.ExecuteActions:   [3/5] EnvQueryGenerator_Cover.cpp
UnrealBuildTool.Main: CompilationResultException: Error: OtherCompilationError
UnrealBuildTool.Main:    bei UnrealBuildTool.ActionGraph.ExecuteActions(BuildConfiguration BuildConfiguration, List`1 ActionsToExecute) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\ActionGraph.cs:Zeile 175.
UnrealBuildTool.Main:    bei UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:Zeile 323.
UnrealBuildTool.Main:    bei UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:Zeile 197.
UnrealBuildTool.Main:    bei UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:Zeile 477.
Timeline.Print: Timeline:
Timeline.Print: 
Timeline.Print: [ 0.000]
Timeline.Print: [ 0.000](+0.021) <unknown>
Timeline.Print: [ 0.021](+0.003) FileMetadataPrefetch.QueueEngineDirectory()
Timeline.Print: [ 0.025](+0.208) XmlConfig.ReadConfigFiles()
Timeline.Print: [ 0.233](+0.000) SingleInstanceMutex.Acquire()
Timeline.Print: [ 0.234](+0.122) UEBuildPlatform.RegisterPlatforms()
Timeline.Print:   0.235          [ 0.001](+0.098) Initializing InstalledPlatformInfo
Timeline.Print:   0.333          [ 0.099](+0.000) Querying types
Timeline.Print:   0.334          [ 0.100](+0.001) MacPlatformFactory
Timeline.Print:   0.336          [ 0.102](+0.000) TVOSPlatformFactory
Timeline.Print:   0.336          [ 0.102](+0.000) AndroidPlatformFactory
Timeline.Print:   0.336          [ 0.102](+0.000) HoloLensPlatformFactory
Timeline.Print:   0.336          [ 0.102](+0.000) IOSPlatformFactory
Timeline.Print:   0.337          [ 0.103](+0.000) HTML5PlatformFactory
Timeline.Print:   0.337          [ 0.103](+0.000) LinuxPlatformFactory
Timeline.Print:   0.337          [ 0.103](+0.000) LuminPlatformFactory
Timeline.Print:   0.337          [ 0.103](+0.019) WindowsPlatformFactory
Timeline.Print: [ 0.364](+0.014) TargetDescriptor.ParseCommandLine()
Timeline.Print: [ 0.387](+0.783) UEBuildTarget.Create()
Timeline.Print:   0.391          [ 0.003](+0.167) RulesCompiler.CreateTargetRulesAssembly()
Timeline.Print:   0.391            0.003          [ 0.000](+0.072) <unknown>
Timeline.Print:   0.464            0.076          [ 0.072](+0.031) Finding engine modules
Timeline.Print:   0.495            0.107          [ 0.104](+0.005) Finding plugin modules
Timeline.Print:   0.500            0.112          [ 0.109](+0.044) <unknown>
Timeline.Print:   0.545            0.157          [ 0.153](+0.002) Finding program modules
Timeline.Print:   0.548            0.160          [ 0.156](+0.002) Finding program targets
Timeline.Print:   0.558          [ 0.170](+0.085) RulesAssembly.CreateTargetRules()
Timeline.Print:   0.655          [ 0.267](+0.160) UEBuildTarget constructor
Timeline.Print:   0.663            0.275          [ 0.007](+0.150) Reading source file metadata cache
Timeline.Print:   0.816          [ 0.428](+0.355) UEBuildTarget.PreBuildSetup()
Timeline.Print: [ 1.174](+5.665) UEBuildTarget.Build()
Timeline.Print:   1.174          [ 0.000](+0.048) <unknown>
Timeline.Print:   1.223          [ 0.048](+0.033) ExternalExecution.SetupUObjectModules()
Timeline.Print:   1.256          [ 0.082](+0.046) <unknown>
Timeline.Print:   1.303          [ 0.128](+5.275) Executing UnrealHeaderTool
Timeline.Print:   6.580          [ 5.405](+0.002) ExternalExecution.ResetCachedHeaderInfo()
Timeline.Print:   6.582          [ 5.407](+0.009) ExternalExecution.UpdateDirectoryTimestamps()
Timeline.Print:   6.605          [ 5.430](+0.179) UEBuildBinary.Build()
Timeline.Print:   6.785          [ 5.610](+0.055) <unknown>
Timeline.Print: [ 6.840](+0.021) <unknown>
Timeline.Print: [ 6.862](+0.007) Reading dependency cache
Timeline.Print: [ 6.869](+0.003) Reading action history
Timeline.Print: [ 6.873](+0.034) ActionGraph.GetActionsToExecute()
Timeline.Print:   6.874          [ 0.000](+0.010) Prefetching include dependencies
Timeline.Print:   6.884          [ 0.010](+0.022) Cache outdated actions
Timeline.Print: [ 6.911](+2.457) ActionGraph.ExecuteActions()
Timeline.Print: [ 9.369](+0.061) <unknown>
Timeline.Print: [ 9.430](+0.000) FileMetadataPrefetch.Stop()
Timeline.Print: [ 9.434]

Thank you in advance!

Data members within UHT parsed types need to be compiled out with #if WITH_EDITORONLY_DATA rather than #if WITH_EDITOR (which you do use for functions).

Alright, thank you very much!