diff --git a/index.html b/index.html index 19f80e5e..df07d894 100644 --- a/index.html +++ b/index.html @@ -8039,7 +8039,7 @@ - + @@ -8065,7 +8065,7 @@ - + diff --git a/libs/simplify.js b/libs/simplify.js index ecae2ba9..e4086e53 100644 --- a/libs/simplify.js +++ b/libs/simplify.js @@ -42,8 +42,9 @@ const newPoints = [prevPoint]; let point; - for (let i = 1, len = points.length; i < len; i++) { + for (let i = 1; i < points.length; i++) { point = points[i]; + if (!point) continue; if (getSqDist(point, prevPoint) > sqTolerance) { newPoints.push(point); @@ -51,8 +52,7 @@ } } - if (point && prevPoint !== point) newPoints.push(point); - + if (prevPoint !== point) newPoints.push(point); return newPoints; } diff --git a/utils/pathUtils.js b/utils/pathUtils.js index 57667233..4f023595 100644 --- a/utils/pathUtils.js +++ b/utils/pathUtils.js @@ -158,7 +158,7 @@ function connectVertices({vertices, startingVertex, ofSameType, addToChecked, cl else if (v2 !== previous && c2 !== c3) next = v2; else if (v3 !== previous && c1 !== c3) next = v3; - if (!vertices.c[next]) { + if (next >= vertices.c.length) { ERROR && console.error("ConnectVertices: next vertex is out of bounds"); break; } diff --git a/versioning.js b/versioning.js index 87fabf96..0afaecdd 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.5"; +const VERSION = "1.105.6"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); {