mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
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
This commit is contained in:
parent
00c6d2c91c
commit
52b52d3c5e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user