summaryrefslogtreecommitdiff
path: root/nodejs/lib/ships.ts
diff options
context:
space:
mode:
authorJulien Dessaux2024-05-05 00:08:28 +0200
committerJulien Dessaux2024-05-05 00:08:28 +0200
commit5aac233c08567844d6b99afb4d0a1a56725dd6c4 (patch)
tree337d883da98b020d4652b612eaa2d06fd9a1f5d5 /nodejs/lib/ships.ts
parent[node] crudely handle tradevolume limit while selling (diff)
downloadspacetraders-5aac233c08567844d6b99afb4d0a1a56725dd6c4.tar.gz
spacetraders-5aac233c08567844d6b99afb4d0a1a56725dd6c4.tar.bz2
spacetraders-5aac233c08567844d6b99afb4d0a1a56725dd6c4.zip
[node] fix shortest path to only hop through refueling points
Diffstat (limited to '')
-rw-r--r--nodejs/lib/ships.ts2
1 files changed, 1 insertions, 1 deletions
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<void> {
- 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;