Fixed extraction issue with ships not carrying antimatter
This commit is contained in:
parent
19107b153e
commit
88ef5666ca
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ async function mineUntilFullOf(ctx) {
|
||||||
let good = response.data.cargo.inventory.filter(i => i.symbol === ctx.good)[0];
|
let good = response.data.cargo.inventory.filter(i => i.symbol === ctx.good)[0];
|
||||||
const inventory = response.data.cargo.inventory.filter(i => i.symbol !== ctx.good);
|
const inventory = response.data.cargo.inventory.filter(i => i.symbol !== ctx.good);
|
||||||
const antimatter = response.data.cargo.inventory.filter(i => i.symbol === 'ANTIMATTER')[0];
|
const antimatter = response.data.cargo.inventory.filter(i => i.symbol === 'ANTIMATTER')[0];
|
||||||
if (good?.units + antimatter?.units >= response.data.cargo.capacity * 0.9) { // > 90% full of the valuable goods
|
if (good?.units + (antimatter?.units ?? 0) >= response.data.cargo.capacity * 0.9) { // > 90% full of the valuable goods
|
||||||
return good.units;
|
return good.units;
|
||||||
} else { // we are full but need to sell junk
|
} else { // we are full but need to sell junk
|
||||||
await ships.dock({ship: ctx.ship});
|
await ships.dock({ship: ctx.ship});
|
||||||
|
|
Loading…
Add table
Reference in a new issue