diff options
-rw-r--r-- | engines/saga/interface.cpp | 10 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 13 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 5 |
3 files changed, 15 insertions, 13 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index c7054436d9..941262e10e 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -369,18 +369,18 @@ int Interface::deactivate() { } void Interface::rememberMode() { - assert (_savedMode == -1); + debug(1, "rememberMode(%d)", _savedMode); _savedMode = _panelMode; - - debug(1, "rememberMode(%d)", _savedMode); } void Interface::restoreMode(bool draw_) { - assert (_savedMode != -1); - debug(1, "restoreMode(%d)", _savedMode); + // If _savedMode is -1 by a race condition, set it to kPanelMain + if (_savedMode == -1) + _savedMode = kPanelMain; + _panelMode = _savedMode; _savedMode = -1; diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 6e51296bad..3c98421361 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -1361,12 +1361,13 @@ void Scene::clearPlacard() { } void Scene::clearPsychicProfile() { - _vm->_scene->clearPlacard(); - _vm->_actor->showActors(false); - _vm->_gfx->restorePalette(); - _vm->_scene->restoreScene(); - _vm->_interface->setMode(kPanelMain); - _vm->_interface->activate(); + if (_vm->_interface->getMode() == kPanelPlacard) { + _vm->_scene->clearPlacard(); + _vm->_actor->showActors(false); + _vm->_gfx->restorePalette(); + _vm->_scene->restoreScene(); + _vm->_interface->activate(); + } } void Scene::showIHNMDemoSpecialScreen() { diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 61d8caaaf0..ef1ecd587f 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -1519,8 +1519,9 @@ void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) { void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) { thread->wait(kWaitTypePlacard); - // This is not used - //_vm->_scene->clearPsychicProfile(); + // This is called a while after the psychic profile is + // opened, to close it automatically + _vm->_scene->clearPsychicProfile(); } // Script function #50 (0x32) |