From 9aba6496f9c70a606f1dd6ca5dd34b12edcc15a7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 19 Oct 2021 13:04:18 +0300 Subject: [PATCH] AD: Fixed tail md5 comparisons --- engines/advancedDetector.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 91cbe121e32..7b53d40a339 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -574,7 +574,7 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) { Common::String fname = Common::punycode_decodefilename(fileDesc->fileName); - Common::String key = flagsToMD5Prefix(g->flags) + ':' + fname; + Common::String key = Common::String::format("%c:%s", flagsToMD5Prefix(g->flags), fname.c_str()); if (filesProps.contains(key)) continue; @@ -616,7 +616,7 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa // Try to match all files for this game for (fileDesc = game.desc->filesDescriptions; fileDesc->fileName; fileDesc++) { Common::String tstr = Common::punycode_decodefilename(fileDesc->fileName); - Common::String key = flagsToMD5Prefix(g->flags) + ':' + tstr; + Common::String key = Common::String::format("%c:%s", flagsToMD5Prefix(g->flags), tstr.c_str()); if (!filesProps.contains(key) || filesProps[key].size == -1) { allFilesPresent = false; @@ -628,13 +628,13 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa if (game.hasUnknownFiles) continue; - if (fileDesc->md5 != nullptr && fileDesc->md5 != filesProps[tstr].md5) { + if (fileDesc->md5 != nullptr && fileDesc->md5 != filesProps[key].md5) { debugC(3, kDebugGlobalDetection, "MD5 Mismatch. Skipping (%s) (%s)", fileDesc->md5, filesProps[key].md5.c_str()); game.hasUnknownFiles = true; continue; } - if (fileDesc->fileSize != -1 && fileDesc->fileSize != filesProps[tstr].size) { + if (fileDesc->fileSize != -1 && fileDesc->fileSize != filesProps[key].size) { debugC(3, kDebugGlobalDetection, "Size Mismatch. Skipping (%ld) (%ld)", fileDesc->fileSize, filesProps[key].size); game.hasUnknownFiles = true; continue;