From b610a00f0fa79d5ea89684ff42aecb51fd50999d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Sat, 29 Jan 2022 12:01:42 +0100 Subject: [PATCH] Add note about a possible oversight --- src/pathfinding.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pathfinding.js b/src/pathfinding.js index 27a05d6..721aea5 100644 --- a/src/pathfinding.js +++ b/src/pathfinding.js @@ -92,6 +92,8 @@ function* neighbors(pos) { } function calculatePath(from, to) { + // On 5/10/5 it's possible that we'd need to start on layer 1 if there is a previous route + // However I cannot think of any case where not doing it would lead to a non-optimal path, so I've ommited that const nextNodes = [{node: getNode(to), cost: 0, estimated: estimateCost(to, from), previous: null}]; const previousNodes = new Set(); while (nextNodes.length > 0) {