From 2ea468d5daecc0f47a690b690e7fcdeddfcc2490 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 17 Feb 2023 01:01:32 +0100 Subject: [PATCH] Ignore constant error due to missing Game Settings in Editor (log once) --- Source/Engine/Core/Config/GameSettings.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Core/Config/GameSettings.cpp b/Source/Engine/Core/Config/GameSettings.cpp index 4d135ebb5..8de9bce1e 100644 --- a/Source/Engine/Core/Config/GameSettings.cpp +++ b/Source/Engine/Core/Config/GameSettings.cpp @@ -22,7 +22,7 @@ #include "Engine/Engine/Globals.h" #include "Engine/Profiler/ProfilerCPU.h" #include "Engine/Streaming/StreamingSettings.h" -#if FLAX_TESTS +#if FLAX_TESTS || USE_EDITOR #include "Engine/Platform/FileSystem.h" #endif @@ -91,6 +91,19 @@ GameSettings* GameSettings::Get() // Silence missing GameSettings during test run before Editor creates it (not important) if (!FileSystem::FileExists(assetPath)) return nullptr; +#endif +#if USE_EDITOR + // Log once missing GameSettings in Editor + if (!FileSystem::FileExists(assetPath)) + { + static bool LogOnce = true; + if (LogOnce) + { + LogOnce = false; + LOG(Error, "Missing file game settings asset ({0}\)", assetPath); + } + return nullptr; + } #endif GameSettingsAsset = Content::LoadAsync(assetPath); if (GameSettingsAsset == nullptr)