From ddb35d321c89702d88bf7b16d1e42950f560cee5 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Fri, 13 Jan 2017 11:34:18 +0000 Subject: [PATCH 1/2] Fix issue where filling all internals with cargo racks would include restricted slots --- ChangeLog.md | 3 +++ src/app/components/InternalSlotSection.jsx | 19 ++++++++++--------- src/app/shipyard/ShipRoles.js | 4 +++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index cd0122af..1aeb6e70 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +#2.2.8 + * Fix issue where filling all internals with cargo racks would include restricted slots + #2.2.7 * Fix resistance diminishing return calculations * Do not allow -100% to be entered as a modification value diff --git a/src/app/components/InternalSlotSection.jsx b/src/app/components/InternalSlotSection.jsx index af60b841..38d65415 100644 --- a/src/app/components/InternalSlotSection.jsx +++ b/src/app/components/InternalSlotSection.jsx @@ -4,6 +4,7 @@ import SlotSection from './SlotSection'; import InternalSlot from './InternalSlot'; import * as ModuleUtils from '../shipyard/ModuleUtils'; import { stopCtxPropagation } from '../utils/UtilityFunctions'; +import { canMount } from '../utils/SlotFunctions'; /** * Internal slot section @@ -47,7 +48,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.cr)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'cr')) { ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E')); } }); @@ -63,7 +64,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.ft)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'ft')) { ship.use(slot, ModuleUtils.findInternal('ft', slot.maxClass, 'C')); } }); @@ -79,7 +80,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pcq)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'pcq')) { ship.use(slot, ModuleUtils.findInternal('pcq', Math.min(slot.maxClass, 6), 'B')); // Passenger cabins top out at 6 } }); @@ -95,7 +96,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pcm)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'pcm')) { ship.use(slot, ModuleUtils.findInternal('pcm', Math.min(slot.maxClass, 6), 'C')); // Passenger cabins top out at 6 } }); @@ -111,7 +112,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pci)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'pci')) { ship.use(slot, ModuleUtils.findInternal('pci', Math.min(slot.maxClass, 6), 'D')); // Passenger cabins top out at 6 } }); @@ -127,7 +128,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.pce)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'pce')) { ship.use(slot, ModuleUtils.findInternal('pce', Math.min(slot.maxClass, 6), 'E')); // Passenger cabins top out at 6 } }); @@ -144,7 +145,7 @@ export default class InternalSlotSection extends SlotSection { let ship = this.props.ship; let chargeCap = 0; // Capacity of single activation ship.internal.forEach(function(slot) { - if ((clobber || (!slot.m && !ModuleUtils.isShieldGenerator(slot.m.grp))) && (!slot.eligible || slot.eligible.scb)) { + if ((clobber && !(slot.m && ModuleUtils.isShieldGenerator(slot.m.grp)) || !slot.m) && canMount(ship, slot, 'scb')) { ship.use(slot, ModuleUtils.findInternal('scb', slot.maxClass, 'A')); ship.setSlotEnabled(slot, chargeCap <= ship.shieldStrength); // Don't waste cell capacity on overcharge chargeCap += slot.m.recharge; @@ -162,7 +163,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.hr)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'hr')) { ship.use(slot, ModuleUtils.findInternal('hr', Math.min(slot.maxClass, 5), 'D')); // Hull reinforcements top out at 5D } }); @@ -178,7 +179,7 @@ export default class InternalSlotSection extends SlotSection { let clobber = event.getModifierState('Alt'); let ship = this.props.ship; ship.internal.forEach((slot) => { - if ((clobber || !slot.m) && (!slot.eligible || slot.eligible.mrp)) { + if ((clobber || !slot.m) && canMount(ship, slot, 'mrp')) { ship.use(slot, ModuleUtils.findInternal('mrp', Math.min(slot.maxClass, 5), 'D')); // Module reinforcements top out at 5D } }); diff --git a/src/app/shipyard/ShipRoles.js b/src/app/shipyard/ShipRoles.js index 42b03ee6..0ebbf0d7 100644 --- a/src/app/shipyard/ShipRoles.js +++ b/src/app/shipyard/ShipRoles.js @@ -39,7 +39,9 @@ export function trader(ship, shielded, standardOpts) { ship.use(slot, sg); sg = null; } else { - ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E')); + if (canMount(ship, slot, 'cr')) { + ship.use(slot, ModuleUtils.findInternal('cr', slot.maxClass, 'E')); + } } } From 260f29834acaabe8c6e52db4cf3e6b0f7f50435e Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Fri, 13 Jan 2017 11:35:01 +0000 Subject: [PATCH 2/2] Update release notes --- ChangeLog.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1aeb6e70..1bb56d58 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ #2.2.8 * Fix issue where filling all internals with cargo racks would include restricted slots + * Use coriolis-data 2.2.8: + * Set military slot of Viper Mk IV to class 3; was incorrectly set as class 2 + * Update base regeneration rate of prismatic shield generators to values in 2.2.03 + * Update specials with information in 2.2.03 #2.2.7 * Fix resistance diminishing return calculations diff --git a/package.json b/package.json index 81d6de35..f7aaf34f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.2.7", + "version": "2.2.8", "repository": { "type": "git", "url": "https://github.com/EDCD/coriolis"