aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/statics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r--engines/fullpipe/statics.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 717de84925..de3e1ea728 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -246,7 +246,7 @@ bool StaticANIObject::load(MfcArchive &file) {
void StaticANIObject::setOXY(int x, int y) {
_ox = x;
_oy = y;
-
+
if (_movement)
_movement->setOXY(x, y);
}
@@ -713,7 +713,7 @@ void StaticANIObject::setSpeed(int speed) {
void StaticANIObject::setAlpha(int alpha) {
for (uint i = 0; i < _movements.size(); i++)
_movements[i]->setAlpha(alpha);
-
+
for (uint i = 0; i < _staticsList.size(); i++)
_staticsList[i]->setAlpha(alpha);
}
@@ -1048,8 +1048,11 @@ MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
if (_flags & 1)
_messageQueueId = mq->_id;
} else {
- if (!queueMessageQueue(mq))
+ if (!queueMessageQueue(mq)) {
+ delete mq;
+
return 0;
+ }
g_fp->_globalMessageQueueList->addMessageQueue(mq);
}
@@ -1594,6 +1597,12 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an
newSize = src->_dynamicPhases.size();
}
+ if (!newSize) {
+ warning("Movement::Movement: newSize = 0");
+
+ return;
+ }
+
_framePosOffsets = (Common::Point **)calloc(newSize, sizeof(Common::Point *));
for (int i = 0; i < newSize; i++)
@@ -1813,7 +1822,7 @@ void Movement::initStatics(StaticANIObject *ani) {
_staticsObj2 = ani->addReverseStatics(_currMovement->_staticsObj2);
_staticsObj1 = ani->addReverseStatics(_currMovement->_staticsObj1);
-
+
_mx = _currMovement->_mx;
_my = _currMovement->_my;
@@ -2279,7 +2288,7 @@ bool StaticPhase::load(MfcArchive &file) {
_initialCountdown = file.readUint16LE();
_field_6A = file.readUint16LE();
-
+
if (g_fp->_gameProjectVersion >= 12) {
_exCommand = (ExCommand *)file.readClass();