From dfa90da8af8974a847349f748e78389c565b05e9 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 30 Jun 2022 20:19:48 +0200 Subject: [PATCH] check if Resources/Server directory exists, and only create it if it doesnt While this doesn't make a difference with usual setups, it does if the server path exists but is a symlink. In that case, the create_directories call fails, and the server aborts. this fixes that. :^) --- src/TLuaEngine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index 74b01c3..050f416 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -274,7 +274,9 @@ std::shared_ptr TLuaEngine::EnqueueFunctionCall(TLuaStateId StateID, } void TLuaEngine::CollectAndInitPlugins() { - fs::create_directories(mResourceServerPath); + if (!fs::exists(mResourceServerPath)) { + fs::create_directories(mResourceServerPath); + } for (const auto& Dir : fs::directory_iterator(mResourceServerPath)) { auto Path = Dir.path(); Path = fs::relative(Path);