diff options
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r-- | engines/fullpipe/statics.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index de3e1ea728..059fd82e79 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -106,9 +106,14 @@ bool StepArray::gotoNextPoint() { } void StepArray::insertPoints(Common::Point **points, int pointsCount) { - if (_currPointIndex + pointsCount >= _pointsCount) + if (_currPointIndex + pointsCount >= _pointsCount) { _points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount)); + if (!_points) { + error("Out of memory at StepArray::insertPoints()"); + } + } + _maxPointIndex = _currPointIndex + pointsCount; for (int i = 0; i < pointsCount; i++) { @@ -1571,6 +1576,9 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an _m2x = 0; _m2y = 0; + _counter = 0; + _counterMax = 0; + _field_78 = 0; _framePosOffsets = 0; _field_84 = 0; @@ -1758,8 +1766,8 @@ Common::Point *Movement::calcSomeXY(Common::Point &p, int idx, int dynidx) { Common::Point point; _staticsObj1->getSomeXY(point); - int y1 = _my - point.y; int x1 = _mx - point.x; + int y1 = _my - point.y; setDynamicPhaseIndex(0); |