From 1e4e76af0f231bc02871d36fae65810f6cf9a994 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 21 Oct 2009 14:13:08 +0000 Subject: [PATCH] Fixed self-intersecting pathfinding polygons in SQ1, room 66. This addresses the issue where Roger is able to walk anywhere on screen. However, there is still a separate issue in that room, which makes him stay stuck in one direction (like he's "moonwalking") and it only occurs in the new GUI svn-id: r45307 --- engines/sci/engine/kpathing.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index b2d396c08a6..adb5b0075b6 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1267,6 +1267,21 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { } for (i = skip; i < size; i++) { + if (size == 35 && (i == 20 || i == 21) && s->_gameName == "sq1sci" && + s->currentRoomNumber() == 66) { + if (i == 20 && read_point(segMan, points, 20) == Common::Point(0, 104)) { + debug(1, "Applying fix for self-intersecting polygon in SQ1, room 66"); + Vertex *vertex = new Vertex(Common::Point(1, 104)); + poly->vertices.insertHead(vertex); + continue; + } else if (i == 21 && read_point(segMan, points, 21) == Common::Point(0, 110)) { + debug(1, "Applying fix for self-intersecting polygon in SQ1, room 66"); + Vertex *vertex = new Vertex(Common::Point(1, 110)); + poly->vertices.insertHead(vertex); + continue; + } + } + Vertex *vertex = new Vertex(read_point(segMan, points, i)); poly->vertices.insertHead(vertex); }