[node] fixed mining and selling loop issues
This commit is contained in:
parent
3cb4f4df51
commit
719a9c1a77
4 changed files with 15 additions and 11 deletions
|
@ -58,9 +58,11 @@ async function runProcurement(contract: Contract, ships: Array<Ship>) {
|
|||
await libShips.navigate(ship, asteroidSymbol);
|
||||
break;
|
||||
default:
|
||||
// we were either selling or started contracting
|
||||
await selling.sell(ship, wantedCargo);
|
||||
await libShips.navigate(ship, asteroidSymbol);
|
||||
if (libShips.isFull(ship)) {
|
||||
await selling.sell(ship, wantedCargo);
|
||||
} else {
|
||||
await libShips.navigate(ship, asteroidSymbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO repurpose the ship
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue