mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
feat: submap - fix route gen
This commit is contained in:
parent
93c0889442
commit
f587805da9
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue