diff options
author | Julien Dessaux | 2024-03-29 00:24:51 +0100 |
---|---|---|
committer | Julien Dessaux | 2024-03-29 00:24:51 +0100 |
commit | 719a9c1a77733040de8e1c4256b92111dcc53c13 (patch) | |
tree | 4cc20d3a386507085840b8880ad4350754fbecf2 /nodejs/automation/selling.ts | |
parent | [node] stop trying to optimize useless things like local database calls (diff) | |
download | spacetraders-719a9c1a77733040de8e1c4256b92111dcc53c13.tar.gz spacetraders-719a9c1a77733040de8e1c4256b92111dcc53c13.tar.bz2 spacetraders-719a9c1a77733040de8e1c4256b92111dcc53c13.zip |
[node] fixed mining and selling loop issues
Diffstat (limited to 'nodejs/automation/selling.ts')
-rw-r--r-- | nodejs/automation/selling.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nodejs/automation/selling.ts b/nodejs/automation/selling.ts index 987b8ae..04b0e9d 100644 --- a/nodejs/automation/selling.ts +++ b/nodejs/automation/selling.ts @@ -19,10 +19,10 @@ export async function sell(ship: Ship, good: string): Promise<Ship> { // can we sell anything here? const goods = whatCanBeTradedAt(cargo.goods, market.imports.concat(market.exchange)); for (let i = 0; i < goods.length; i++) { - const symbol = goods[i].symbol; - await libShips.sell(ship, good); + await libShips.sell(ship, goods[i].symbol); }; // are we done selling everything we can? + ship = dbShips.getShip(ship.symbol); cargo = utils.categorizeCargo(ship.cargo, good); if (Object.keys(cargo.goods).length === 0) { return ship; |