[node] fix shortest path to only hop through refueling points
This commit is contained in:
parent
063b2c9951
commit
5aac233c08
3 changed files with 26 additions and 14 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue