diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 50f0dfe720..7d4d4999cc 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -94,14 +94,21 @@ void ScriptEngine::LoadPlugins() } } - // Enable hot reloading - _pluginFileWatcher = std::make_unique(base); - _pluginFileWatcher->OnFileChanged = - [this](const std::string &path) - { - std::lock_guard guard(_changedPluginFilesMutex); - _changedPluginFiles.push_back(path); - }; + try + { + // Enable hot reloading + _pluginFileWatcher = std::make_unique(base); + _pluginFileWatcher->OnFileChanged = + [this](const std::string &path) + { + std::lock_guard 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()