aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/statics.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index a5bbf21151..de1fc77b13 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -108,20 +108,22 @@ bool StepArray::gotoNextPoint() {
void StepArray::insertPoints(Common::Point **points, int pointsCount) {
if (_currPointIndex + pointsCount >= _pointsCount) {
- _points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount));
+ _points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_pointsCount + pointsCount));
if (!_points) {
error("Out of memory at StepArray::insertPoints()");
}
+
+ for(int i = 0; i < pointsCount; i++)
+ _points[_pointsCount + i] = new Common::Point;
+
+ _pointsCount += pointsCount;
}
_maxPointIndex = _currPointIndex + pointsCount;
- for (int i = 0; i < pointsCount; i++) {
- _points[_currPointIndex + i] = new Common::Point;
-
+ for (int i = 0; i < pointsCount; i++)
*_points[_currPointIndex + i] = *points[i];
- }
}
StaticANIObject::StaticANIObject() {