mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
When starting a game, make sure that it has the desired target name. The old
behaviour was to simply pick the first detected game, which made it necessary to keep the Puzzle Pack data files in different directories. Now they can all be in the same one. (Generally it's not a good idea to keep several games in the same directory, of course, but in this case it's perfectly reasonable.) svn-id: r24020
This commit is contained in:
parent
907141c909
commit
6a1f9eee64
@ -1666,18 +1666,22 @@ bool AGOSEngine::initGame() {
|
||||
if (ConfMan.hasKey("platform"))
|
||||
platform = Common::parsePlatform(ConfMan.get("platform"));
|
||||
|
||||
Common::String gameid = ConfMan.get("gameid");
|
||||
|
||||
// At this point, Engine_AGOS_create() has already verified that the
|
||||
// desired game is in the specified directory. But we've already
|
||||
// forgotten which particular version it was, so we have to do it all
|
||||
// over again...
|
||||
|
||||
count = detectGame(NULL, language, platform, matches);
|
||||
|
||||
if (count == 0) {
|
||||
warning("No valid games were found in the specified directory.");
|
||||
return false;
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (toDetectedGame(gameDescriptions[matches[i]]).gameid == gameid) {
|
||||
gameNumber = matches[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (count != 1)
|
||||
warning("Conflicting targets detected (%d)", count);
|
||||
|
||||
gameNumber = matches[0];
|
||||
|
||||
free(matches);
|
||||
|
||||
if (gameNumber >= gameCount || gameNumber == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user