Do nothing if a module has no experimentals

This fixes materials not being shown for modules that can be engineered but not having experimental effects
This commit is contained in:
Sid Pranjale
2022-11-09 21:19:02 +05:30
parent 9bc6e36f14
commit 17c6ec1f97

View File

@@ -177,14 +177,16 @@ export default class ModalShoppingList extends TranslatedComponent {
mats[i] = module.m.blueprint.grades[g].components[i] * this.state.matsPerGrade[g]; mats[i] = module.m.blueprint.grades[g].components[i] * this.state.matsPerGrade[g];
} }
} }
for (const j in module.m.blueprint.special.components) { if (module.m.blueprint.special) {
if (!module.m.blueprint.special.components.hasOwnProperty(j)) { for (const j in module.m.blueprint.special.components) {
continue; if (!module.m.blueprint.special.components.hasOwnProperty(j)) {
} continue;
if (mats[j]) { }
mats[j] += module.m.blueprint.special.components[j]; if (mats[j]) {
} else { mats[j] += module.m.blueprint.special.components[j];
mats[j] = module.m.blueprint.special.components[j]; } else {
mats[j] = module.m.blueprint.special.components[j];
}
} }
} }
} }