From 5df2e08c1668c6649f7817688ce1ce198e563083 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 19 Jan 2015 23:54:07 +0200 Subject: ZVISION: Fix bug #6771 (unable to leave room when loading a game) Avoid overwriting the previous location when loading a saved game --- engines/zvision/scripting/script_manager.cpp | 8 ++++---- engines/zvision/scripting/script_manager.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index bcc1f0a5ff..34376cee5b 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -74,7 +74,7 @@ void ScriptManager::initialize() { void ScriptManager::update(uint deltaTimeMillis) { if (_currentLocation.node != _nextLocation.node || _currentLocation.room != _nextLocation.room || _currentLocation.view != _nextLocation.view || _currentLocation.world != _nextLocation.world) { - ChangeLocationReal(); + ChangeLocationReal(false); } updateNodes(deltaTimeMillis); @@ -560,7 +560,7 @@ void ScriptManager::changeLocation(char _world, char _room, char _node, char _vi } } -void ScriptManager::ChangeLocationReal() { +void ScriptManager::ChangeLocationReal(bool isLoading) { assert(_nextLocation.world != 0); debug(1, "Changing location to: %c %c %c %c %u", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view, _nextLocation.offset); @@ -595,7 +595,7 @@ void ScriptManager::ChangeLocationReal() { _engine->setRenderDelay(2); if (!enteringMenu) { - if (!leavingMenu) { + if (!isLoading && !leavingMenu) { setStateValue(StateKey_LastWorld, getStateValue(StateKey_World)); setStateValue(StateKey_LastRoom, getStateValue(StateKey_Room)); setStateValue(StateKey_LastNode, getStateValue(StateKey_Node)); @@ -809,7 +809,7 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { _nextLocation = nextLocation; - ChangeLocationReal(); + ChangeLocationReal(true); _engine->setRenderDelay(10); setStateValue(StateKey_RestoreFlag, 1); diff --git a/engines/zvision/scripting/script_manager.h b/engines/zvision/scripting/script_manager.h index f6201c3572..6d025bf2e9 100644 --- a/engines/zvision/scripting/script_manager.h +++ b/engines/zvision/scripting/script_manager.h @@ -273,7 +273,7 @@ private: bool execScope(ScriptScope &scope); /** Perform change location */ - void ChangeLocationReal(); + void ChangeLocationReal(bool isLoading); int8 inventoryGetCount(); void inventorySetCount(int8 cnt); -- cgit v1.2.3