aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-08-26 11:33:15 +0000
committerTravis Howell2006-08-26 11:33:15 +0000
commit4de0c30ad1bdec5e37a4ebb5c3ea6ca5f07eff09 (patch)
tree33b0944515577b36fb69708aa306fd95d5edbca4
parenta4ac594d21dd0f892be4b855f46b5d7a73a65f7a (diff)
downloadscummvm-rg350-4de0c30ad1bdec5e37a4ebb5c3ea6ca5f07eff09.tar.gz
scummvm-rg350-4de0c30ad1bdec5e37a4ebb5c3ea6ca5f07eff09.tar.bz2
scummvm-rg350-4de0c30ad1bdec5e37a4ebb5c3ea6ca5f07eff09.zip
Fix bug #1544801 - ITE: Engine creates launcher entry when failing to launch
svn-id: r23751
-rw-r--r--engines/saga/game.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp
index a1bdda6b57..61af35f93f 100644
--- a/engines/saga/game.cpp
+++ b/engines/saga/game.cpp
@@ -77,9 +77,29 @@ DetectedGameList Engine_SAGA_detectGames(const FSList &fslist) {
}
PluginError Engine_SAGA_create(OSystem *syst, Engine **engine) {
+ assert(syst);
assert(engine);
- *engine = new Saga::SagaEngine(syst);
- return kNoError;
+
+ FSList fslist;
+ FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("SagaEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
+
+ // Invoke the detector
+ Common::String gameid = ConfMan.get("gameid");
+ DetectedGameList detectedGames = Engine_SAGA_detectGames(fslist);
+
+ for (uint i = 0; i < detectedGames.size(); i++) {
+ if (detectedGames[i].gameid == gameid) {
+ *engine = new Saga::SagaEngine(syst);
+ return kNoError;
+ }
+ }
+
+ warning("SagaEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+ return kNoGameDataFoundError;
}
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");