diff options
author | Travis Howell | 2006-08-26 11:33:15 +0000 |
---|---|---|
committer | Travis Howell | 2006-08-26 11:33:15 +0000 |
commit | 4de0c30ad1bdec5e37a4ebb5c3ea6ca5f07eff09 (patch) | |
tree | 33b0944515577b36fb69708aa306fd95d5edbca4 /engines/saga | |
parent | a4ac594d21dd0f892be4b855f46b5d7a73a65f7a (diff) | |
download | scummvm-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
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/game.cpp | 24 |
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"); |