mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 18:41:23 +01:00
refactor: drawCoastline
This commit is contained in:
parent
088faf9e26
commit
ec236d146b
2 changed files with 14 additions and 25 deletions
|
|
@ -159,6 +159,11 @@ 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]) {
|
||||
ERROR && console.error("ConnectVertices: next vertex is out of bounds");
|
||||
break;
|
||||
}
|
||||
|
||||
if (next === current) {
|
||||
ERROR && console.error("ConnectVertices: next vertex is not found");
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue