forked from rosebudai/OpenRCT2-Web
Do not crash if plugins directory is missing
This commit is contained in:
1 parent
5ba96a34ac
commit
24eafb0a86
1 file changed
+15
-8
@@ -94,14 +94,21 @@ void ScriptEngine::LoadPlugins()
|
||||
}
|
||||
}
|
||||
|
||||
// Enable hot reloading
|
||||
_pluginFileWatcher = std::make_unique<FileWatcher>(base);
|
||||
_pluginFileWatcher->OnFileChanged =
|
||||
[this](const std::string &path)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(_changedPluginFilesMutex);
|
||||
_changedPluginFiles.push_back(path);
|
||||
};
|
||||
try
|
||||
{
|
||||
// Enable hot reloading
|
||||
_pluginFileWatcher = std::make_unique<FileWatcher>(base);
|
||||
_pluginFileWatcher->OnFileChanged =
|
||||
[this](const std::string &path)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(_changedPluginFilesMutex);
|
||||
_changedPluginFiles.push_back(path);
|
||||
};
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::printf("Unable to enable hot reloading of plugins: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEngine::AutoReloadPlugins()
|
||||
|
||||
Reference in new issue
Block a user