From 4185a736db4048f0795347f4b47d2ede5df21443 Mon Sep 17 00:00:00 2001
From: Lab1 <account@vr.rwth-aachen.de>
Date: Tue, 24 Jan 2023 09:32:16 +0100
Subject: [PATCH] slightly change when search paths to the tmp folder are
 added, otherwise it always fails on the first time starting an app

---
 Source/VAPlugin/Private/VAServerLauncher.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Source/VAPlugin/Private/VAServerLauncher.cpp b/Source/VAPlugin/Private/VAServerLauncher.cpp
index edba891..a418dc2 100644
--- a/Source/VAPlugin/Private/VAServerLauncher.cpp
+++ b/Source/VAPlugin/Private/VAServerLauncher.cpp
@@ -196,6 +196,9 @@ bool FVAServerLauncher::SendFileToVAServer(const FString& RelativeFilename)
 			if(BytesRead==3 && Response[0]=='a' && Response[1]=='c' && Response[2]=='k')
 			{
 				FVAUtils::LogStuff("[FVAServerLauncher::SendFileToVAServer()]: File was received by VAServerLauncher successfully!", false);
+				//the search path is added potenitally multiple times, but can only be added once the folder is created (which the above guarantees)
+				const std::string SearchPath = "../tmp/" + std::string(TCHAR_TO_UTF8(*GetDefault<UGeneralProjectSettings>()->ProjectName));
+				FVAPlugin::AddVAServerSearchPath(SearchPath);
 			}
 			else
 			{
@@ -218,7 +221,7 @@ bool FVAServerLauncher::SendFileToVAServer(const FString& RelativeFilename)
 		return false;	
 	}
 
-	//the search path is added once after connecting to a new server
+	//the search path is added in any case once after connecting to a new server
 
 	return true;
 }
-- 
GitLab