feat: routes - auto-update - add connections

This commit is contained in:
Azgaar 2024-08-13 17:28:47 +02:00
parent e09c0e5344
commit 9e7fd25afd
2 changed files with 21 additions and 6 deletions

View file

@ -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;