aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
authoreriktorbjorn2011-08-14 11:01:10 +0200
committereriktorbjorn2011-08-14 11:01:10 +0200
commita6e638de6e558a6d4f760c7c425d6df29f4090c9 (patch)
tree1bfe1ef0e2fc89f945409a27314f9b5816df23b3 /base/main.cpp
parent72a9f06f93c06aca4572c8a257cdee806e04efb2 (diff)
downloadscummvm-rg350-a6e638de6e558a6d4f760c7c425d6df29f4090c9.tar.gz
scummvm-rg350-a6e638de6e558a6d4f760c7c425d6df29f4090c9.tar.bz2
scummvm-rg350-a6e638de6e558a6d4f760c7c425d6df29f4090c9.zip
MAIN: Avoid adding the same extra path twice
This doesn't make any practical difference, since the search manager already guards against duplicate paths, but it does get rid of a slightly confusing warning message when you have a global extra path configured.
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 780015d307..a0792a9ad2 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -186,9 +186,15 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
}
// If a second extrapath is specified on the app domain level, add that as well.
+ // However, since the default hasKey() and get() check the app domain level,
+ // verify that it's not already there before adding it. The search manager will
+ // check for that too, so this check is mostly to avoid a warning message.
if (ConfMan.hasKey("extrapath", Common::ConfigManager::kApplicationDomain)) {
- dir = Common::FSNode(ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain));
- SearchMan.addDirectory(dir.getPath(), dir);
+ Common::String extraPath = ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain);
+ if (!SearchMan.hasArchive(extraPath)) {
+ dir = Common::FSNode(extraPath);
+ SearchMan.addDirectory(dir.getPath(), dir);
+ }
}
// On creation the engine should have set up all debug levels so we can use