From 719a9c1a77733040de8e1c4256b92111dcc53c13 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 29 Mar 2024 00:24:51 +0100 Subject: [node] fixed mining and selling loop issues --- nodejs/automation/selling.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nodejs/automation/selling.ts') 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 { // 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; -- cgit v1.2.3