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. :^)
This commit is contained in:
Lion Kortlepel 2022-06-30 20:19:48 +02:00
parent 6e46d5aca9
commit dfa90da8af
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -274,7 +274,9 @@ std::shared_ptr<TLuaResult> 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);