summaryrefslogtreecommitdiff
path: root/nodejs/automation/contracting.ts
diff options
context:
space:
mode:
authorJulien Dessaux2024-03-28 12:11:36 +0100
committerJulien Dessaux2024-03-28 12:11:36 +0100
commit3cb4f4df51059919b292fefb5f7a3e1ad99c9a91 (patch)
treebf97a8bdea32985f4c1a95e3759d5044b398789d /nodejs/automation/contracting.ts
parent[node] finished the great typescript rewrite (diff)
downloadspacetraders-3cb4f4df51059919b292fefb5f7a3e1ad99c9a91.tar.gz
spacetraders-3cb4f4df51059919b292fefb5f7a3e1ad99c9a91.tar.bz2
spacetraders-3cb4f4df51059919b292fefb5f7a3e1ad99c9a91.zip
[node] stop trying to optimize useless things like local database calls
Diffstat (limited to '')
-rw-r--r--nodejs/automation/contracting.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/nodejs/automation/contracting.ts b/nodejs/automation/contracting.ts
index aa4cd95..344672a 100644
--- a/nodejs/automation/contracting.ts
+++ b/nodejs/automation/contracting.ts
@@ -46,8 +46,8 @@ async function runProcurement(contract: Contract, ships: Array<Ship>) {
// Then it depends on where we are
switch (ship.nav.waypointSymbol) {
case asteroidSymbol:
- ship = await mining.mineUntilFullOf(wantedCargo, ship, asteroidSymbol);
- ship = await libShips.navigate(ship, deliveryPoint);
+ await mining.mineUntilFullOf(wantedCargo, ship, asteroidSymbol);
+ await libShips.navigate(ship, deliveryPoint);
break;
case deliveryPoint:
if (goodCargo !== undefined) { // we could be here if a client restart happens right after selling before we navigate away
@@ -55,12 +55,12 @@ async function runProcurement(contract: Contract, ships: Array<Ship>) {
contract = await contracts.deliver(contract, ship);
if (contract.fulfilled) break;
}
- ship = await libShips.navigate(ship, asteroidSymbol);
+ await libShips.navigate(ship, asteroidSymbol);
break;
default:
// we were either selling or started contracting
- ship = await selling.sell(ship, wantedCargo);
- ship = await libShips.navigate(ship, asteroidSymbol);
+ await selling.sell(ship, wantedCargo);
+ await libShips.navigate(ship, asteroidSymbol);
}
}
// TODO repurpose the ship