mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.3.04a
This commit is contained in:
parent
c8f758ab3c
commit
d1c795494d
12 changed files with 215 additions and 117 deletions
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
// directly connect first port with the farthest one on the same island to remove gap
|
||||
void function() {
|
||||
if (pack.features[f].type === "lake") return;
|
||||
if (!pack.features[f] || pack.features[f].type === "lake") return;
|
||||
const portsOnIsland = ports.filter(b => cells.f[b.cell] === cells.f[first]);
|
||||
if (portsOnIsland.length < 4) return;
|
||||
const opposite = ports[d3.scan(portsOnIsland, (a, b) => ((b.y - ports[0].y) ** 2 + (b.x - ports[0].x) ** 2) - ((a.y - ports[0].y) ** 2 + (a.x - ports[0].x) ** 2))].cell;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue