From a23c7f93446af13debb5b4f68d02bdd3950dc690 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Konstantin=20K=C3=BChlem?=
 <konstantin.kuehlem@rwth-aachen.de>
Date: Tue, 1 Oct 2024 12:26:52 +0200
Subject: [PATCH] Potential fix for crash in BeginPlay when loading a map the
 first time in the editor session through the study framework, if it has
 library depedencies

---
 Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp b/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp
index a97fba8..16e3006 100644
--- a/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp
+++ b/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp
@@ -456,7 +456,7 @@ void USFGameInstance::PreloadAllMaps(const TArray<USFCondition*>& Conditions)
 
 	for (FString Map : Maps)
 	{
-		LoadPackage(nullptr, *Map, LOAD_None);
+		LoadPackage(nullptr, *Map, LOAD_DeferDependencyLoads);
 	}
 	FSFLoggingUtils::Log("Sucessfully preloaded all maps.");
 }
-- 
GitLab