aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-10-13 20:16:32 -0400
committerPaul Gilbert2015-10-13 20:16:32 -0400
commit8ee889beb44cf828abe5d3a7479ba544b9fc86dd (patch)
treee34e8253c1e4e44b7382f97682d1fcb507d6ea65 /engines/sherlock
parentaab728802d6292de53dbcc11c9bc862cd3a664cd (diff)
downloadscummvm-rg350-8ee889beb44cf828abe5d3a7479ba544b9fc86dd.tar.gz
scummvm-rg350-8ee889beb44cf828abe5d3a7479ba544b9fc86dd.tar.bz2
scummvm-rg350-8ee889beb44cf828abe5d3a7479ba544b9fc86dd.zip
SHERLOCK: RT: Refactor out incorrectly working _loadingSavedGame
This likely fixes just about every remaining outstanding bug report. The variable, for a savegame being loaded, was only reset when a previously loaded scene was freed. But if you loaded a game directly from the launcher, there was no previous scene to free, and the variable remained set. Which meant that you could do things in the scene and then either leave the scene or make another save without the _sceneStats update method being called to reflect the changes made in the change in the global flags.
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/scene.cpp8
-rw-r--r--engines/sherlock/scene.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index c86282fe0e..6f9ef179a3 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -216,7 +216,6 @@ Scene::Scene(SherlockEngine *vm): _vm(vm) {
_currentScene = -1;
_goToScene = -1;
- _loadingSavedGame = false;
_walkedInScene = false;
_version = 0;
_compressed = false;
@@ -274,6 +273,8 @@ void Scene::selectScene() {
}
void Scene::freeScene() {
+ SaveManager &saves = *_vm->_saves;
+
if (_currentScene == -1)
return;
@@ -284,10 +285,8 @@ void Scene::freeScene() {
_vm->_music->freeSong();
_vm->_sound->freeLoadedSounds();
- if (!_loadingSavedGame)
+ if (!saves._justLoaded)
saveSceneStatus();
- else
- _loadingSavedGame = false;
_sequenceBuffer.clear();
_descText.clear();
@@ -1390,7 +1389,6 @@ void Scene::synchronize(Serializer &s) {
s.syncAsSint16LE(_currentScene);
} else {
s.syncAsSint16LE(_goToScene);
- _loadingSavedGame = true;
}
for (int sceneNum = 1; sceneNum < SCENES_COUNT; ++sceneNum) {
diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h
index 3e3bed6f96..f7aa39fd41 100644
--- a/engines/sherlock/scene.h
+++ b/engines/sherlock/scene.h
@@ -145,8 +145,6 @@ public:
class Scene {
private:
- bool _loadingSavedGame;
-
/**
* Loads sounds for the scene
*/