mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: routes - auto-update - add connections
This commit is contained in:
parent
e09c0e5344
commit
9e7fd25afd
2 changed files with 21 additions and 6 deletions
|
|
@ -179,10 +179,11 @@ window.Routes = (function () {
|
|||
for (const {points, i: routeId} of routes) {
|
||||
const cells = points.map(p => p[2]);
|
||||
|
||||
for (let i = 0; i < cells.length; i++) {
|
||||
for (let i = 0; i < cells.length - 1; i++) {
|
||||
const cellId = cells[i];
|
||||
const nextCellId = cells[i + 1];
|
||||
if (nextCellId && cellId !== nextCellId) {
|
||||
|
||||
if (cellId !== nextCellId) {
|
||||
if (!links[cellId]) links[cellId] = {};
|
||||
links[cellId][nextCellId] = routeId;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue