mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
MADS: Properly set the scene revisited flag when loading a saved game
This commit is contained in:
parent
94160a28e3
commit
6d6afda883
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
/**
|
||||
* Synchronizes the list
|
||||
*/
|
||||
void synchronize(Common::Serializer &s);
|
||||
void synchronize(Common::Serializer &s, int sceneId);
|
||||
};
|
||||
|
||||
class SectionHandler {
|
||||
|
Loading…
x
Reference in New Issue
Block a user