From 5f9858844a24b00e75ef2c504b2d68c189261dd2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 20 Jan 2015 01:21:16 +0200 Subject: ZVISION: Fix saving when using the original save dialog A regression from commit dcac5be493 --- engines/zvision/scripting/script_manager.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'engines/zvision/scripting') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 34376cee5b..a4491103e6 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -594,26 +594,30 @@ void ScriptManager::ChangeLocationReal(bool isLoading) { _engine->setRenderDelay(2); - if (!enteringMenu) { - if (!isLoading && !leavingMenu) { + if (!leavingMenu) { + if (!isLoading && !enteringMenu) { setStateValue(StateKey_LastWorld, getStateValue(StateKey_World)); setStateValue(StateKey_LastRoom, getStateValue(StateKey_Room)); setStateValue(StateKey_LastNode, getStateValue(StateKey_Node)); setStateValue(StateKey_LastView, getStateValue(StateKey_View)); setStateValue(StateKey_LastViewPos, getStateValue(StateKey_ViewPos)); + } else { + setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); + setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); + setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); + setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); + setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } - } else { - setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); - setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); - setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); - setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); - setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } - if (isSaveScreen && !leavingMenu) { - _engine->getSaveManager()->prepareSaveBuffer(); - } else if (leavingMenu) { - _engine->getSaveManager()->flushSaveBuffer(); + if (enteringMenu) { + if (isSaveScreen && !leavingMenu) { + _engine->getSaveManager()->prepareSaveBuffer(); + } + } else { + if (leavingMenu) { + _engine->getSaveManager()->flushSaveBuffer(); + } } setStateValue(StateKey_World, _nextLocation.world); -- cgit v1.2.3