aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2017-12-01 22:43:16 +0100
committerEugene Sandulenko2017-12-01 22:43:16 +0100
commitcee6a336f2fca7c7c55184fbb6599507c737c9cd (patch)
treee9883073bb9b780574a2ec2cb66f15b539912325 /engines/fullpipe
parent8f8b2ed003f9ba998ab4717fad533a2bc8ae1369 (diff)
downloadscummvm-rg350-cee6a336f2fca7c7c55184fbb6599507c737c9cd.tar.gz
scummvm-rg350-cee6a336f2fca7c7c55184fbb6599507c737c9cd.tar.bz2
scummvm-rg350-cee6a336f2fca7c7c55184fbb6599507c737c9cd.zip
FULLPIPE: Fix bug #9673: Unable to move after loading a save from the title screen
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/fullpipe.cpp27
-rw-r--r--engines/fullpipe/fullpipe.h2
-rw-r--r--engines/fullpipe/modal.h1
3 files changed, 19 insertions, 11 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 6f8e642cc6..f50593cc3a 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -230,6 +230,8 @@ bool FullpipeEngine::shouldQuit() {
}
Common::Error FullpipeEngine::loadGameState(int slot) {
+ deleteModalObject();
+
if (_gameLoader->readSavegame(getSavegameFile(slot)))
return Common::kNoError;
else
@@ -343,11 +345,7 @@ void FullpipeEngine::updateEvents() {
if (_modalObject->init(42)) {
_modalObject->update();
} else {
- _modalObject->saveload();
- BaseModalObject *obj = _modalObject->_parentObj;
- if (obj)
- delete _modalObject;
- _modalObject = obj;
+ deleteModalObject();
}
} else {
_gameLoader->updateSystems(42);
@@ -470,6 +468,18 @@ void FullpipeEngine::cleanup() {
stopAllSoundStreams();
}
+void FullpipeEngine::deleteModalObject() {
+ if (!_modalObject)
+ return;
+
+ _modalObject->saveload();
+ BaseModalObject *tmp = _modalObject->_parentObj;
+
+ delete _modalObject;
+
+ _modalObject = tmp;
+}
+
void FullpipeEngine::updateScreen() {
debugC(4, kDebugDrawing, "FullpipeEngine::updateScreen()");
@@ -484,12 +494,7 @@ void FullpipeEngine::updateScreen() {
if (_modalObject->init(42)) {
_modalObject->update();
} else {
- _modalObject->saveload();
- BaseModalObject *tmp = _modalObject->_parentObj;
-
- delete _modalObject;
-
- _modalObject = tmp;
+ deleteModalObject();
}
}
} else if (_currentScene) {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index cd7b120952..2039989c91 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -225,6 +225,8 @@ public:
Common::Array<Common::Point> _arcadeKeys;
+ void deleteModalObject();
+
void initMap();
void updateMap(PreloadItem *pre);
void updateMapPiece(int mapId, int update);
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index 1bc576c70e..9f5e4088cb 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -51,6 +51,7 @@ class BaseModalObject {
BaseModalObject() : _parentObj(0) { _objtype = kObjTypeDefault; }
virtual ~BaseModalObject() {}
+ void deleteObject();
virtual bool pollEvent() = 0;
virtual bool handleMessage(ExCommand *message) = 0;