aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-11-28 15:17:12 -0500
committerEugene Sandulenko2013-11-29 02:34:38 -0500
commit73612b897934fd33183ebf3f93658e30f24314cf (patch)
treeeab468769edeab8b70e5316c4c4164170006c3aa
parenta742b5fe8c6f09dd017c645c65d4cdff35f47202 (diff)
downloadscummvm-rg350-73612b897934fd33183ebf3f93658e30f24314cf.tar.gz
scummvm-rg350-73612b897934fd33183ebf3f93658e30f24314cf.tar.bz2
scummvm-rg350-73612b897934fd33183ebf3f93658e30f24314cf.zip
FULLPIPE: Fix crash at scene04 start
-rw-r--r--engines/fullpipe/statics.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index c86d5abd08..d14c3d83e2 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -152,15 +152,19 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
_statics = 0;
for (uint i = 0; i < src->_movements.size(); i++) {
- Movement *mov;
- if (((Movement *)src->_movements[i])->_currMovement) {
- mov = new Movement(getMovementById(src->getMovementIdById(((Movement *)src->_movements[i])->_id)), this);
- mov->_id = ((Movement *)src->_movements[i])->_id;
+ Movement *newmov;
+ Movement *mov = (Movement *)src->_movements[i];
+
+ if (mov->_currMovement) {
+ // WORKAROUND: Original uses weird construction here:
+ // new Movement(getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov = new Movement(src->getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov->_id = mov->_id;
} else {
- mov = new Movement(((Movement *)src->_movements[i]), 0, -1, this);
+ newmov = new Movement(mov, 0, -1, this);
}
- _movements.push_back(mov);
+ _movements.push_back(newmov);
}
}