From 2fd2af3e31a26944911cf318525ee59b1c8efde3 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Thu, 11 May 2017 12:45:57 +0100 Subject: [PATCH] Ensure that hidden blueprint effects are applied when a blueprint is selected --- ChangeLog.md | 3 +++ package.json | 2 +- src/app/shipyard/Ship.js | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 77370c4c..869c41fe 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +#2.3.5 + * Ensure that hidden blueprint effects are applied when a blueprint is selected + #2.3.4 * Fix crash when removing the special effect from a module * Ensure comparisons with saved stock ships work correctly diff --git a/package.json b/package.json index e32028bb..6a49971a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.3.4", + "version": "2.3.5-b", "repository": { "type": "git", "url": "https://github.com/EDCD/coriolis" diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index d3855cc8..258bfa38 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -435,6 +435,14 @@ export default class Ship { */ setModuleBlueprint(m, bp) { m.blueprint = bp; + this.clearModifications(m); + // Set any hidden items for the blueprint now + const features = m.blueprint.grades[m.blueprint.grade].features; + for (const featureName in features) { + if (Modifications.modifications[featureName].hidden) { + this.setModification(m, featureName, bp.grades[bp.grade].features[featureName][0]); + } + } this.updateModificationsString(); }