summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp8
-rw-r--r--src/gui/windows/updaterwindow.cpp15
2 files changed, 18 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 649c1f08c..3f049340f 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1176,10 +1176,12 @@ int Client::gameExec()
Net::getPartyHandler()->clear();
if (chatLogger)
chatLogger->clear();
- if (mOptions.dataPath.empty())
- UpdaterWindow::unloadMods(mOldUpdates);
- else
+ if (!mOptions.dataPath.empty())
UpdaterWindow::unloadMods(mOptions.dataPath);
+ else
+ UpdaterWindow::unloadMods(mOldUpdates);
+ if (!mOptions.skipUpdate)
+ UpdaterWindow::unloadMods(mOldUpdates + "/fix/");
}
mOldState = mState;
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);
+ }
}
}