From 5aac233c08567844d6b99afb4d0a1a56725dd6c4 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 5 May 2024 00:08:28 +0200 Subject: [node] fix shortest path to only hop through refueling points --- nodejs/lib/ships.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nodejs/lib/ships.ts') diff --git a/nodejs/lib/ships.ts b/nodejs/lib/ships.ts index ff38164..74419fc 100644 --- a/nodejs/lib/ships.ts +++ b/nodejs/lib/ships.ts @@ -103,7 +103,7 @@ export class Ship { return this.cargo.units >= this.cargo.capacity * 0.9; } async navigate(waypoint: Waypoint): Promise { - let path = shortestPath(await libSystems.waypoint(this.nav.route.destination.symbol), waypoint, this.fuel.capacity, await libSystems.waypoints(this.nav.systemSymbol)); + let path = await shortestPath(await libSystems.waypoint(this.nav.route.destination.symbol), waypoint, this.fuel.capacity, await libSystems.waypoints(this.nav.systemSymbol)); while (path.length > 0) { const next = path.pop(); if (next === undefined) break; -- cgit v1.2.3