diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp index 4fc6fed96b1..e418716c45c 100644 --- a/engines/asylum/asylum.cpp +++ b/engines/asylum/asylum.cpp @@ -311,6 +311,10 @@ void AsylumEngine::processDelayedEvents() { // XXX Flag 183 indicates whether the actionlist is currently // processing if (sceneIdx >= 0 && isGameFlagNotSet(kGameFlagScriptProcessing)) { + + // Reset delayed scene + _scene->actions()->setDelayedSceneIndex(-1); + _sound->stopMusic(); _sound->stopAllSounds(); @@ -319,8 +323,6 @@ void AsylumEngine::processDelayedEvents() { _scene = new Scene(sceneIdx, this); _scene->enterScene(); - - _scene->actions()->setDelayedSceneIndex(-1); } } diff --git a/engines/asylum/console.cpp b/engines/asylum/console.cpp index a8a813760b2..09252a6ddf5 100644 --- a/engines/asylum/console.cpp +++ b/engines/asylum/console.cpp @@ -280,12 +280,17 @@ bool Console::cmdChangeScene(int32 argc, const char **argv) { return true; } - if (atoi(argv[1]) - 4 < 1 || atoi(argv[1]) - 4 >= 15) { - DebugPrintf("[Error] Invalid world: %d\n", atoi(argv[1])); + int index = atoi(argv[1]); + + // Check if the scene exists + char filename[20]; + sprintf(filename, "scn.%03d", index); + if (!SearchMan.hasFile(filename)) { + DebugPrintf("[Error] Scene %d does not exists\n", index); return true; } - _vm->scene()->actions()->setDelayedSceneIndex(atoi(argv[1])); + _vm->scene()->actions()->setDelayedSceneIndex(index); // FIXME push the script index into the script queue // XXX is this right or should it be ws->actionListIdx??? //_vm->scene()->actions()->setScriptByIndex(0);