feat: submap - fix route gen

This commit is contained in:
Azgaar 2024-12-08 15:59:49 +01:00
parent 93c0889442
commit f587805da9

View file

@ -129,6 +129,7 @@ window.Routes = (function () {
function findPathSegments({isWater, connections, start, exit}) {
const getCost = createCostEvaluator({isWater, connections});
const pathCells = findPath(start, current => current === exit, getCost);
if (!pathCells) return [];
const segments = getRouteSegments(pathCells, connections);
return segments;
}