From c60c0c967651422a4d2027c3b7c156bfcfc548d3 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Sat, 9 Mar 2019 23:15:18 +0200 Subject: BLADERUNNER: Alternate fix method for rare path finding assert faults Disabled by default. This one allows polygons merged on a single point. --- engines/bladerunner/obstacles.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/bladerunner/obstacles.h') diff --git a/engines/bladerunner/obstacles.h b/engines/bladerunner/obstacles.h index af17184393..9cec3d4f15 100644 --- a/engines/bladerunner/obstacles.h +++ b/engines/bladerunner/obstacles.h @@ -71,7 +71,7 @@ class Obstacles { bool _backup; static bool lineLineIntersection(LineSegment a, LineSegment b, Vector2 *intersectionPoint); - static bool linePolygonIntersection(LineSegment lineA, VertexType lineAType, Polygon *polyB, Vector2 *intersectionPoint, int *intersectionIndex); + static bool linePolygonIntersection(LineSegment lineA, VertexType lineAType, Polygon *polyB, Vector2 *intersectionPoint, int *intersectionIndex, int pathLengthSinceLastIntersection); bool mergePolygons(Polygon &polyA, Polygon &PolyB); @@ -93,7 +93,7 @@ public: float pathTotalDistance(const Vector2 *path, int pathSize, Vector2 from, Vector2 to) const; bool findPolygonVerticeByXZ(int *polygonIndex, int *verticeIndex, int *verticeCount, float x, float z) const; - bool findPolygonVerticeByXZWithinTolerance(float x, float z, int *polygonIndex, int *verticeIndex) const; + bool findPolygonVerticeByXZWithinTolerance(float x, float z, int *polygonIndex, int *verticeIndex, int startSearchFromPolygonIdx) const; void clearPath(); int buildNegativePath(int polyIndex, int vertStartIndex, Vector2 startPos, int vertEndIndex, Vector2 endPos, Vector2 *path, int pathCapacity, bool *pathBlocked); -- cgit v1.2.3