diff options
author | Max Horn | 2005-05-05 12:03:16 +0000 |
---|---|---|
committer | Max Horn | 2005-05-05 12:03:16 +0000 |
commit | fecc4d5f8481fcd3f303cd06f0cb25c66f50326b (patch) | |
tree | 22d437d47b95a058d1ab9e712c1adfafb378f808 | |
parent | 28e40b33a7fbc70d1d882e159eadd29dfbcef0ef (diff) | |
download | scummvm-rg350-fecc4d5f8481fcd3f303cd06f0cb25c66f50326b.tar.gz scummvm-rg350-fecc4d5f8481fcd3f303cd06f0cb25c66f50326b.tar.bz2 scummvm-rg350-fecc4d5f8481fcd3f303cd06f0cb25c66f50326b.zip |
Return 0 in Engine_SCUMM_create if the game isn't found (instead of computing the MD5 of non-existant files)
svn-id: r17917
-rw-r--r-- | scumm/scumm.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index d87f3f1b4f..aec23886f1 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -2658,8 +2658,10 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { break; g++; } - if (!g->name) + if (!g->name) { error("Invalid game '%s'\n", detector->_game.name); + return 0; + } ScummGameSettings game = *g; @@ -2687,14 +2689,20 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { } strcpy(tempName, detectName); - File f; - + bool found = false; while (substLastIndex != -1) { - if (f.exists(detectName, ConfMan.get("path").c_str())) + if (File::exists(detectName, ConfMan.get("path").c_str())) { + found = true; break; + } substLastIndex = generateSubstResFileName_(tempName, detectName, sizeof(detectName), substLastIndex + 1); } + + // Unable to locate game data + if (!found) { + return 0; + } // Force game to have Mac platform if needed if (substLastIndex > 0) { |