diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/plugin.cpp | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index d2f699343d..d8b0cfc1a4 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -115,10 +115,6 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system) } int KyraEngine::init() { - if (setupGameFlags()) { - return -1; - } - // Setup mixer if (!_mixer->isReady()) { warning("Sound initialization failed."); diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp index 18b9c4f1dd..18b56ab22c 100644 --- a/engines/kyra/plugin.cpp +++ b/engines/kyra/plugin.cpp @@ -272,6 +272,21 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) { *engine = new KyraEngine_v3(syst); } else error("Kyra engine created with invalid gameid."); + + FSList fslist; + FilesystemNode dir(ConfMan.get("path")); + if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) { + warning("KyraEngine: invalid game path '%s'", dir.path().c_str()); + return kInvalidPathError; + } + + if (*engine) { + if (((KyraEngine*)(*engine))->setupGameFlags()) { + warning("KyraEngine: unable to locate game data at path '%s'", dir.path().c_str()); + delete *engine; + return kNoGameDataFoundError; + } + } return kNoError; } |