From bb658e8b5951fff920364d5a35f69c10c5875887 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Sat, 23 Nov 2024 20:57:24 +0000 Subject: [PATCH] Fixes Blueprint selection issue caused by fixing overcharged_blueprint. --- src/app/components/ModificationsMenu.jsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/components/ModificationsMenu.jsx b/src/app/components/ModificationsMenu.jsx index f3b3cbb2..c1ed558d 100644 --- a/src/app/components/ModificationsMenu.jsx +++ b/src/app/components/ModificationsMenu.jsx @@ -422,16 +422,19 @@ export default class ModificationsMenu extends TranslatedComponent { let haveBlueprint = false; let blueprintTt; let blueprintCv; + let bprintSearchName; - // Set the bprintSearchName value to the fdname of the blueprint for this module - let bprintSearchName = m.blueprint.fdname; // If the fdname is Weapon_Overcharged, we need to check if it's an MC - if (m.blueprint.fdname === 'Weapon_Overcharged') { - // If the module is a MultiCannon, we need to fix the blueprint search name, else it will find the Laser Weapon_Overcharged Blueprint and not the MC Weapon_Overcharged Blueprint - if (m.symbol.match(/MultiCannon/i)) { - // console.log(Modifications.modules[m.grp].blueprints['MC_Overcharged']); - // console.log(m.blueprint.fdname); - bprintSearchName = 'MC_Overcharged'; + if (m.blueprint && m.blueprint.fdname) { + // Set the bprintSearchName value to the fdname of the blueprint for this module + bprintSearchName = m.blueprint.fdname; + if (m.blueprint.fdname === 'Weapon_Overcharged') { + // If the module is a MultiCannon, we need to fix the blueprint search name, else it will find the Laser Weapon_Overcharged Blueprint and not the MC Weapon_Overcharged Blueprint + if (m.symbol.match(/MultiCannon/i)) { + // console.log(Modifications.modules[m.grp].blueprints['MC_Overcharged']); + // console.log(m.blueprint.fdname); + bprintSearchName = 'MC_Overcharged'; + } } } // TODO: Fix this to actually find the correct blueprint.