BASE: Refactor EngineManager::createTargetForGame

This commit is contained in:
Roberto Sánchez 2022-12-06 15:42:54 +01:00 committed by Eugene Sandulenko
parent 5854585b33
commit 7f457f8e94

View File

@ -773,15 +773,7 @@ Common::String EngineManager::createTargetForGame(const DetectedGame &game) {
Common::String domain = game.preferredTarget;
assert(!domain.empty());
if (ConfMan.hasGameDomain(domain)) {
int suffixN = 1;
Common::String gameid(domain);
while (ConfMan.hasGameDomain(domain)) {
domain = gameid + Common::String::format("-%d", suffixN);
suffixN++;
}
}
domain = generateUniqueDomain(domain);
// Add the name domain
ConfMan.addGameDomain(domain);