ENGINES: Allow engines to decide if unknown variants can be run

This commit is contained in:
Thierry Crozat 2021-04-19 22:28:47 +01:00
parent e3d254d963
commit 0622c9f8fb
2 changed files with 9 additions and 4 deletions

View file

@ -241,8 +241,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
for (uint i = 0; i < matches.size(); i++) {
DetectedGame game = toDetectedGame(matches[i]);
if (game.hasUnknownFiles) {
// Non fallback games with unknown files cannot be added/launched
if (game.hasUnknownFiles && !canPlayUnknownVariants()) {
game.canBeAdded = false;
}
@ -251,7 +250,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
bool foundKnownGames = false;
for (uint i = 0; i < detectedGames.size(); i++) {
foundKnownGames |= detectedGames[i].canBeAdded;
foundKnownGames |= !detectedGames[i].hasUnknownFiles;
}
if (!foundKnownGames) {
@ -344,7 +343,7 @@ Common::Error AdvancedMetaEngineDetection::createInstance(OSystem *syst, Engine
ADDetectedGame agdDesc;
for (uint i = 0; i < matches.size(); i++) {
if (matches[i].desc->gameId == gameid && !matches[i].hasUnknownFiles) {
if (matches[i].desc->gameId == gameid && (!matches[i].hasUnknownFiles || canPlayUnknownVariants())) {
agdDesc = matches[i];
break;
}