aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/statics.cpp
diff options
context:
space:
mode:
authorColin Snover2017-11-16 15:06:11 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commitc7b1f6b26c0276f0d9dafb8c4ec4daac268d26c6 (patch)
tree00944ac59a301e8aad08a51c955341b19e71aded /engines/fullpipe/statics.cpp
parenta6fc77ec65561f9f0768322b618f6ceac21f1efc (diff)
downloadscummvm-rg350-c7b1f6b26c0276f0d9dafb8c4ec4daac268d26c6.tar.gz
scummvm-rg350-c7b1f6b26c0276f0d9dafb8c4ec4daac268d26c6.tar.bz2
scummvm-rg350-c7b1f6b26c0276f0d9dafb8c4ec4daac268d26c6.zip
FULLPIPE: Clarify ownership of DynamicPhase::_exCommand
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r--engines/fullpipe/statics.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index a85b90b595..eb28b93f59 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -2112,9 +2112,9 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
_field_7C = src->_field_7C;
if (src->getExCommand())
- _exCommand = src->getExCommand()->createClone();
+ _exCommand.reset(src->getExCommand()->createClone());
else
- _exCommand = 0;
+ _exCommand.reset();
_initialCountdown = src->_initialCountdown;
_field_6A = src->_field_6A;
@@ -2153,11 +2153,6 @@ StaticPhase::StaticPhase() {
_initialCountdown = 0;
_countdown = 0;
_field_68 = 0;
- _exCommand = 0;
-}
-
-StaticPhase::~StaticPhase() {
- delete _exCommand;
}
bool StaticPhase::load(MfcArchive &file) {
@@ -2168,15 +2163,9 @@ bool StaticPhase::load(MfcArchive &file) {
_initialCountdown = file.readUint16LE();
_field_6A = file.readUint16LE();
- if (g_fp->_gameProjectVersion >= 12) {
- _exCommand = file.readClass<ExCommand>();
-
- return true;
- }
-
- assert (g_fp->_gameProjectVersion >= 12);
+ assert(g_fp->_gameProjectVersion >= 12);
- warning("StaticPhase::load(): Code continues here");
+ _exCommand.reset(file.readClass<ExCommand>());
return true;
}