[Scummvm-cvs-logs] SF.net SVN: scummvm: [24020] scummvm/trunk/engines/agos/game.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Sep 29 20:20:49 CEST 2006


Revision: 24020
          http://svn.sourceforge.net/scummvm/?rev=24020&view=rev
Author:   eriktorbjorn
Date:     2006-09-29 11:20:44 -0700 (Fri, 29 Sep 2006)

Log Message:
-----------
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.)

Modified Paths:
--------------
    scummvm/trunk/engines/agos/game.cpp

Modified: scummvm/trunk/engines/agos/game.cpp
===================================================================
--- scummvm/trunk/engines/agos/game.cpp	2006-09-29 17:18:12 UTC (rev 24019)
+++ scummvm/trunk/engines/agos/game.cpp	2006-09-29 18:20:44 UTC (rev 24020)
@@ -1666,18 +1666,22 @@
 	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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list