Ensure that hidden blueprint effects are applied when a blueprint is selected

This commit is contained in:
Cmdr McDonald
2017-05-11 12:45:57 +01:00
parent f30a904a02
commit 2fd2af3e31
3 changed files with 12 additions and 1 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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();
}