1
0
Fork 0

[node] fixed mining and selling loop issues

This commit is contained in:
Julien Dessaux 2024-03-29 00:24:51 +01:00
parent 3cb4f4df51
commit 719a9c1a77
Signed by: adyxax
GPG key ID: F92E51B86E07177E
4 changed files with 15 additions and 11 deletions

View file

@ -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