summaryrefslogtreecommitdiff
path: root/nodejs/automation/selling.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nodejs/automation/selling.ts')
-rw-r--r--nodejs/automation/selling.ts4
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;