summaryrefslogtreecommitdiff
path: root/src/gui/windows/updaterwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-10 00:37:35 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-10 00:37:35 +0300
commitd78965b4c853ede29a0898cbf0c33c3cc3bbdfa3 (patch)
tree1c6343ee3fe4a309fb615f72e1bb7ba4dfb8aa14 /src/gui/windows/updaterwindow.cpp
parent923633ae61b255c64dee9cf011382086453286d8 (diff)
downloadmanaverse-d78965b4c853ede29a0898cbf0c33c3cc3bbdfa3.tar.gz
manaverse-d78965b4c853ede29a0898cbf0c33c3cc3bbdfa3.tar.bz2
manaverse-d78965b4c853ede29a0898cbf0c33c3cc3bbdfa3.tar.xz
manaverse-d78965b4c853ede29a0898cbf0c33c3cc3bbdfa3.zip
Possible load mods from local/ dir also.
Diffstat (limited to 'src/gui/windows/updaterwindow.cpp')
-rw-r--r--src/gui/windows/updaterwindow.cpp15
1 files changed, 13 insertions, 2 deletions
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);
+ }
}
}