diff options
author | Eugene Sandulenko | 2009-03-09 23:08:44 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-03-09 23:08:44 +0000 |
commit | 52b52d3c5e28d46b279f35be37920130a85ca2de (patch) | |
tree | d70b1f2aea321ad81d31f48833ce6047dd34ed6e /engines/advancedDetector.cpp | |
parent | 00c6d2c91c3216e8687fd67e4a87aca30a7413e5 (diff) | |
download | scummvm-rg350-52b52d3c5e28d46b279f35be37920130a85ca2de.tar.gz scummvm-rg350-52b52d3c5e28d46b279f35be37920130a85ca2de.tar.bz2 scummvm-rg350-52b52d3c5e28d46b279f35be37920130a85ca2de.zip |
Fix for bug #2671611: T7G: Checksums for unknown english 7th Guest cd version
Now instead of showing partial list of files detector will provide "submit
md5" message only if at least one entry with every file present will be
found.
svn-id: r39281
Diffstat (limited to 'engines/advancedDetector.cpp')
-rw-r--r-- | engines/advancedDetector.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 42908e7020..11747b26a2 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -371,6 +371,7 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p ADGameDescList matched; int maxFilesMatched = 0; + bool gotAnyMatchesWithAllFiles = false; // MD5 based matching uint i; @@ -388,12 +389,15 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra) continue; + bool allFilesPresent = true; + // Try to match all files for this game for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) { Common::String tstr = fileDesc->fileName; if (!filesSizeMD5.contains(tstr)) { fileMissing = true; + allFilesPresent = false; break; } @@ -411,6 +415,19 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p debug(3, "Matched file: %s", tstr.c_str()); } + + // We found at least one entry with all required files present. + // That means that we got new variant of the game. + // + // Wihtout this check we would have errorneous checksum display + // where only located files will be enlisted. + // + // Potentially this could rule out variants where some particular file + // is really missing, but the developers should better know about such + // cases. + if (allFilesPresent) + gotAnyMatchesWithAllFiles = true; + if (!fileMissing) { debug(2, "Found game: %s (%s %s/%s) (%d)", g->gameid, g->extra, getPlatformDescription(g->platform), getLanguageDescription(g->language), i); @@ -446,7 +463,7 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p // We didn't find a match if (matched.empty()) { - if (!filesSizeMD5.empty()) { + if (!filesSizeMD5.empty() && gotAnyMatchesWithAllFiles) { reportUnknown(parent, filesSizeMD5); } |