From fb6718080969ca15404f4c3d6d51cf1d6da911ab Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 19 Oct 2017 13:04:37 +0300 Subject: [PATCH] [Server] Fix build in Visual Studio --- apps/openmw-mp/Script/LuaState.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/openmw-mp/Script/LuaState.cpp b/apps/openmw-mp/Script/LuaState.cpp index 032f80d7b..b9e930518 100644 --- a/apps/openmw-mp/Script/LuaState.cpp +++ b/apps/openmw-mp/Script/LuaState.cpp @@ -442,22 +442,21 @@ void LuaState::loadMods(const std::string &modDir, std::vector *lis { using namespace boost::filesystem; - auto readConfig = [this](path path) { + auto readConfig = [this](path homePath){ const auto mainScript = "main.lua"; - if (!is_directory(path / "mods")) - throw runtime_error(path.string() + ": No such directory."); - for (const auto &modDir : directory_iterator(path / "mods")) + if (!is_directory(homePath / "mods")) + throw runtime_error(homePath.string() + ": No such directory."); + for (const auto &modDir : directory_iterator(homePath / "mods")) { if (is_directory(modDir.status()) && exists(modDir.path() / mainScript)) { boost::property_tree::ptree pt; - auto _path = path.string() + "/mods/" + modDir.path().filename().string(); + auto _path = homePath.string() + "/mods/" + modDir.path().filename().string(); boost::property_tree::read_json(_path + "/modinfo.json", pt); ServerPluginInfo modInfo; - - modInfo.path = {path.string(), modDir.path().filename().string()}; + modInfo.path = std::make_pair(homePath.string(), modDir.path().filename().string()); modInfo.author = pt.get("author"); modInfo.version = pt.get("version"); @@ -522,4 +521,4 @@ void LuaState::loadMods(const std::string &modDir, std::vector *lis } dataEnv["Core"]["LOADED_MODS"] = mods.size(); -} \ No newline at end of file +}