aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-04-25 05:11:07 -0500
committerPaul Gilbert2015-04-25 05:11:07 -0500
commitb8e12bbd88dba43cd397aca151eddb47d2ce761a (patch)
tree801e838f8bb035b321ccc59d21a79e56728cb0ea /engines/sherlock
parent2379824e32fd0cb49e3f2b6c997cb6070f0b0393 (diff)
downloadscummvm-rg350-b8e12bbd88dba43cd397aca151eddb47d2ce761a.tar.gz
scummvm-rg350-b8e12bbd88dba43cd397aca151eddb47d2ce761a.tar.bz2
scummvm-rg350-b8e12bbd88dba43cd397aca151eddb47d2ce761a.zip
SHERLOCK: Fix setting scene flags when leaving a scene
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/scene.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 3ecc7be422..3f551ef5ba 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -129,6 +129,9 @@ void Scene::selectScene() {
_oldKey = _help = _oldHelp = 0;
_oldTemp = _temp = 0;
+ // Free any previous scene
+ freeScene();
+
// Load the scene
Common::String sceneFile = Common::String::format("res%02d", _goToScene);
_rrmName = Common::String::format("res%02d.rrm", _goToScene);
@@ -201,7 +204,6 @@ bool Scene::loadScene(const Common::String &filename) {
UserInterface &ui = *_vm->_ui;
bool flag;
- freeScene();
_walkedInScene = false;
_ongoingCans = 0;
@@ -453,12 +455,12 @@ bool Scene::loadScene(const Common::String &filename) {
void Scene::checkSceneStatus() {
if (_sceneStats[_currentScene][64]) {
for (uint idx = 0; idx < 64; ++idx) {
- int val = _sceneStats[_currentScene][idx];
+ bool flag = _sceneStats[_currentScene][idx];
if (idx < _bgShapes.size()) {
Object &obj = _bgShapes[idx];
- if (val & 1) {
+ if (flag) {
// No shape to erase, so flag as hidden
obj._type = HIDDEN;
} else if (obj._images == nullptr || obj._images->size() == 0) {