aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2007-07-08 13:26:55 +0000
committerMax Horn2007-07-08 13:26:55 +0000
commit925f75636951b9697a2c8f97d4c93fb1510fd617 (patch)
tree4318a93ade3bef532c199069434c97cc3e984a4b /engines
parent41989652df45b73abc8353072f386f1099b01281 (diff)
downloadscummvm-rg350-925f75636951b9697a2c8f97d4c93fb1510fd617.tar.gz
scummvm-rg350-925f75636951b9697a2c8f97d4c93fb1510fd617.tar.bz2
scummvm-rg350-925f75636951b9697a2c8f97d4c93fb1510fd617.zip
SCUMM: Handle platform override a bit differently during startup; specifically, be more gentle if no perfect match against the specified platform value was found
svn-id: r27966
Diffstat (limited to 'engines')
-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 2d260a9908..ffbce945e1 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