[Scummvm-cvs-logs] scummvm master -> 8ee889beb44cf828abe5d3a7479ba544b9fc86dd

dreammaster dreammaster at scummvm.org
Wed Oct 14 02:20:05 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8ee889beb4 SHERLOCK: RT: Refactor out incorrectly working _loadingSavedGame


Commit: 8ee889beb44cf828abe5d3a7479ba544b9fc86dd
    https://github.com/scummvm/scummvm/commit/8ee889beb44cf828abe5d3a7479ba544b9fc86dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-10-13T20:16:32-04:00

Commit Message:
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.

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/scene.h



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index c86282f..6f9ef17 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 3e3bed6..f7aa39f 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
 	 */






More information about the Scummvm-git-logs mailing list