aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
authorFilippos Karapetis2014-06-01 15:01:17 +0300
committerFilippos Karapetis2014-06-01 15:18:31 +0300
commit6d6afda8835f996720cfc395fdb1e77daac3d473 (patch)
tree0c4fcd234e1a35b7df3116a12a095dff8513e7f0 /engines/mads
parent94160a28e37326237abf990d280a211349197060 (diff)
downloadscummvm-rg350-6d6afda8835f996720cfc395fdb1e77daac3d473.tar.gz
scummvm-rg350-6d6afda8835f996720cfc395fdb1e77daac3d473.tar.bz2
scummvm-rg350-6d6afda8835f996720cfc395fdb1e77daac3d473.zip
MADS: Properly set the scene revisited flag when loading a saved game
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/game.cpp2
-rw-r--r--engines/mads/game_data.cpp14
-rw-r--r--engines/mads/game_data.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index ed97dca746..ea87a1f4d1 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -477,7 +477,7 @@ void Game::synchronize(Common::Serializer &s, bool phase1) {
_scene.synchronize(s);
_objects.synchronize(s);
- _visitedScenes.synchronize(s);
+ _visitedScenes.synchronize(s, _scene._nextSceneId);
_player.synchronize(s);
_screenObjects.synchronize(s);
} else {
diff --git a/engines/mads/game_data.cpp b/engines/mads/game_data.cpp
index 0e2dcec70f..70e9e6c30b 100644
--- a/engines/mads/game_data.cpp
+++ b/engines/mads/game_data.cpp
@@ -46,9 +46,21 @@ bool VisitedScenes::exists(int sceneId) {
return false;
}
-void VisitedScenes::synchronize(Common::Serializer &s) {
+void VisitedScenes::synchronize(Common::Serializer &s, int sceneId) {
SynchronizedList::synchronize(s);
s.syncAsByte(_sceneRevisited);
+
+ // If the scene hasn't been visited yet, remove it from the visited
+ // scenes list. It'll be readded to the list in add() above, from
+ // Game::sectionLoop()
+ if (s.isLoading() && !_sceneRevisited) {
+ for (uint i = 0; i < size(); ++i) {
+ if ((*this)[i] == sceneId) {
+ remove_at(i);
+ return;
+ }
+ }
+ }
}
} // End of namespace MADS
diff --git a/engines/mads/game_data.h b/engines/mads/game_data.h
index f15cd1a8f0..65a9ae1553 100644
--- a/engines/mads/game_data.h
+++ b/engines/mads/game_data.h
@@ -52,7 +52,7 @@ public:
/**
* Synchronizes the list
*/
- void synchronize(Common::Serializer &s);
+ void synchronize(Common::Serializer &s, int sceneId);
};
class SectionHandler {