From d78965b4c853ede29a0898cbf0c33c3cc3bbdfa3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 10 Jan 2014 00:37:35 +0300 Subject: Possible load mods from local/ dir also. --- src/gui/windows/updaterwindow.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index fe3a4cbcf..dee1d209c 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -1033,6 +1033,7 @@ void UpdaterWindow::loadMods(const std::string &dir, } } + loadDirMods(dir + "/local/"); } void UpdaterWindow::loadDirMods(const std::string &dir) @@ -1051,7 +1052,12 @@ void UpdaterWindow::loadDirMods(const std::string &dir) if (modIt == mods.end()) continue; const ModInfo *const mod = (*modIt).second; - resman->addToSearchPath(dir + "/" + mod->getLocalDir(), false); + if (mod) + { + const std::string localDir = mod->getLocalDir(); + if (!localDir.empty()) + resman->addToSearchPath(dir + "/" + localDir, false); + } } } @@ -1069,6 +1075,11 @@ void UpdaterWindow::unloadMods(const std::string &dir) if (modIt == mods.end()) continue; const ModInfo *const mod = (*modIt).second; - resman->removeFromSearchPath(dir + "/" + mod->getLocalDir()); + if (mod) + { + const std::string localDir = mod->getLocalDir(); + if (!localDir.empty()) + resman->removeFromSearchPath(dir + "/" + localDir); + } } } -- cgit v1.2.3-70-g09d2