diff options
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 9c5973939e..faf966af92 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1098,8 +1098,6 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { return NULL; } - Polygon *poly = new Polygon(readSelectorValue(segMan, polygon, SELECTOR(type))); - SegmentRef pointList = segMan->dereference(points); // Check if the target polygon is still valid. It may have been released // in the meantime (e.g. in LSL6, room 700, when using the elevator). @@ -1129,6 +1127,8 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { } } + Polygon *poly = new Polygon(readSelectorValue(segMan, polygon, SELECTOR(type))); + for (i = skip; i < size; i++) { Vertex *vertex = new Vertex(readPoint(pointList, i)); poly->vertices.insertHead(vertex); |