aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-01-19 23:54:07 +0200
committerFilippos Karapetis2015-01-19 23:54:42 +0200
commit5df2e08c1668c6649f7817688ce1ce198e563083 (patch)
tree9e342bf2a3d9125b3d62727235838abb95e148b0 /engines
parentdcac5be493a98764239619d5da60d6bc0f608383 (diff)
downloadscummvm-rg350-5df2e08c1668c6649f7817688ce1ce198e563083.tar.gz
scummvm-rg350-5df2e08c1668c6649f7817688ce1ce198e563083.tar.bz2
scummvm-rg350-5df2e08c1668c6649f7817688ce1ce198e563083.zip
ZVISION: Fix bug #6771 (unable to leave room when loading a game)
Avoid overwriting the previous location when loading a saved game
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/scripting/script_manager.cpp8
-rw-r--r--engines/zvision/scripting/script_manager.h2
2 files changed, 5 insertions, 5 deletions
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);