aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/detection.cpp
diff options
context:
space:
mode:
authorDavid Corrales2007-07-08 16:58:54 +0000
committerDavid Corrales2007-07-08 16:58:54 +0000
commit9bfe5d53540af7dc9bf0214202f4e35b272320ea (patch)
tree69dcaf6f735e9fd0913a3e2f163852d4b9af87e3 /engines/scumm/detection.cpp
parent256e4d9521b79160d1f9ed670656097a96dc5a34 (diff)
parent17da12ca07a1f18f3fe1ef5b0c2c0cd9fd8359b4 (diff)
downloadscummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.gz
scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.bz2
scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.zip
Merged the FSNode branch with trunk r27681:27969
svn-id: r27970
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r--engines/scumm/detection.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 8624f80fe7..e9430337ff 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -765,19 +765,22 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) {
// narrow down the list a bit more.
if (results.size() > 1 && ConfMan.hasKey("platform")) {
Common::Platform platform = Common::parsePlatform(ConfMan.get("platform"));
+ Common::List<DetectorResult> tmp;
+
+ // Copy only those candidates which match the platform setting
for (Common::List<DetectorResult>::iterator x = results.begin(); x != results.end(); ) {
- if (x->game.platform != platform) {
- x = results.erase(x);
- } else {
- ++x;
+ if (x->game.platform == platform) {
+ tmp.push_back(*x);
}
}
- }
- // If we narrowed it down too much, abort
- if (results.empty()) {
- warning("Engine_SCUMM_create: Game data inconsistent with platform override");
- return kNoGameDataFoundError;
+ // If we narrowed it down too much, print a warning, else use the list
+ // we just computed as new candidates list.
+ if (tmp.empty()) {
+ warning("Engine_SCUMM_create: Game data inconsistent with platform override");
+ } else {
+ results = tmp;
+ }
}
// Still no unique match found -> print a warning