diff --git a/ChangeLog.md b/ChangeLog.md index 54920061..9da99a12 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ * Fix issue where new module added to a slot did not reset its enabled status * Show integrity value for relevant modules * Reset old modification values when a new roll is applied + * Fix issue with miner role where refinery would not be present in ships with class 5 slots but no class 4 #2.2.19 * Power management panel now displays modules in descending order of power usage by default diff --git a/src/app/shipyard/ShipRoles.js b/src/app/shipyard/ShipRoles.js index 8be5c12a..4ddf91fc 100644 --- a/src/app/shipyard/ShipRoles.js +++ b/src/app/shipyard/ShipRoles.js @@ -208,14 +208,14 @@ export function miner(ship, shielded) { // Cargo hatch should be enabled ship.setSlotEnabled(ship.cargoHatch, true); - // 4A or largest possible refinery + // Largest possible refinery const refineryOrder = [4, 5, 6, 7, 8, 3, 2, 1]; const refineryInternals = ship.internal.filter(a => usedSlots.indexOf(a) == -1) .filter(a => (!a.eligible) || a.eligible.rf) .sort((a,b) => refineryOrder.indexOf(a.maxClass) - refineryOrder.indexOf(b.maxClass)); for (let i = 0; i < refineryInternals.length; i++) { if (canMount(ship, refineryInternals[i], 'rf')) { - ship.use(refineryInternals[i], ModuleUtils.findInternal('rf', refineryInternals[i].maxClass, 'A')); + ship.use(refineryInternals[i], ModuleUtils.findInternal('rf', Math.min(refineryInternals[i].maxClass, 4), 'A')); usedSlots.push(refineryInternals[i]); break; }