mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 02:10:28 +00:00
ASYLUM: Check that a scene exists before trying to load it
git-svn-id: http://asylumengine.googlecode.com/svn/trunk@489 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
parent
582794ff12
commit
9249130d59
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user