mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix: issue with feature vertex being out of bound
This commit is contained in:
parent
949a486bf8
commit
84c326e347
4 changed files with 7 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue