aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/advancedDetector.cpp8
-rw-r--r--common/advancedDetector.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 79289072df..8999a60942 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -428,7 +428,13 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
if (curFilesMatched > maxFilesMatched) {
debug(2, " ... new best match, removing all previous candidates");
maxFilesMatched = curFilesMatched;
- matched.clear();
+
+ for (uint j = 0; j < matched.size();) {
+ if (matched[j]->flags & ADGF_KEEPMATCH)
+ ++j;
+ else
+ matched.remove_at(j);
+ }
matched.push_back(g);
} else if (curFilesMatched == maxFilesMatched) {
matched.push_back(g);
diff --git a/common/advancedDetector.h b/common/advancedDetector.h
index bec03d5585..48b9e213d7 100644
--- a/common/advancedDetector.h
+++ b/common/advancedDetector.h
@@ -46,6 +46,8 @@ struct ADGameFileDescription {
enum ADGameFlags {
ADGF_NO_FLAGS = 0,
+ ADGF_KEEPMATCH = (1 << 27), // this entry is kept even when there are matched
+ // entries with more files
ADGF_DROPLANGUAGE = (1 << 28), // don't add language to gameid
ADGF_CD = (1 << 29), // add "-cd" to gameid
ADGF_DEMO = (1 << 30) // add "-demo" to gameid