aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-08-26 11:25:08 +0000
committerTravis Howell2006-08-26 11:25:08 +0000
commita4ac594d21dd0f892be4b855f46b5d7a73a65f7a (patch)
tree34a355351c7851a6a7d413d090346c9915ca47dc /engines
parentc7627bbb5cdb48cc0cec1d125f624343c9743f1c (diff)
downloadscummvm-rg350-a4ac594d21dd0f892be4b855f46b5d7a73a65f7a.tar.gz
scummvm-rg350-a4ac594d21dd0f892be4b855f46b5d7a73a65f7a.tar.bz2
scummvm-rg350-a4ac594d21dd0f892be4b855f46b5d7a73a65f7a.zip
Fix bug #1544799 - SIMON: Engine creates launcher entry when failing to launch.
svn-id: r23749
Diffstat (limited to 'engines')
-rw-r--r--engines/simon/game.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/engines/simon/game.cpp b/engines/simon/game.cpp
index 6c9c70c7f1..2d749a43cb 100644
--- a/engines/simon/game.cpp
+++ b/engines/simon/game.cpp
@@ -113,6 +113,8 @@ DetectedGameList Engine_SIMON_detectGames(const FSList &fslist) {
}
PluginError Engine_SIMON_create(OSystem *syst, Engine **engine) {
+ assert(syst);
+ assert(engine);
const char *gameid = ConfMan.get("gameid").c_str();
for (const ObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) {
@@ -130,9 +132,25 @@ PluginError Engine_SIMON_create(OSystem *syst, Engine **engine) {
}
}
- assert(engine);
- *engine = new Simon::SimonEngine(syst);
- return kNoError;
+ FSList fslist;
+ FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("SimonEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
+
+ // Invoke the detector
+ DetectedGameList detectedGames = Engine_SIMON_detectGames(fslist);
+
+ for (uint i = 0; i < detectedGames.size(); i++) {
+ if (detectedGames[i].gameid == gameid) {
+ *engine = new Simon::SimonEngine(syst);
+ return kNoError;
+ }
+ }
+
+ warning("SimonEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+ return kNoGameDataFoundError;
}
REGISTER_PLUGIN(SIMON, "Simon the Sorcerer", "Simon the Sorcerer (C) Adventure Soft");