From 7e77c7740c777ccd9e0b1dcdc6a2b3e57d2be7e9 Mon Sep 17 00:00:00 2001 From: Phoenix / Hotaru Date: Mon, 10 Jul 2023 05:17:37 +0100 Subject: [PATCH] [Server] Allow spaces after commas for plugins --- apps/openmw-mp/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 5b0bec203..2571affe0 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -197,6 +197,14 @@ int main(int argc, char *argv[]) std::string dataDirectory = Utils::convertPath(pluginHome + "/data"); std::vector plugins(Utils::split(mgr.getString("plugins", "Plugins"), ',')); + // Remove spaces if they exist at the start of the plugin. + for (std::string& plugin : plugins) + { + size_t spacePos = plugin.find_first_not_of(' '); + if (spacePos != std::string::npos && spacePos > 0) { + plugin.erase(0, spacePos); + } + } std::string versionInfo = Utils::getVersionInfo("TES3MP dedicated server", TES3MP_VERSION, version.mCommitHash, TES3MP_PROTO_VERSION); LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "%s", versionInfo.c_str());