From ef42b249c74cd3943767fef749349d01dadf9fd1 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Fri, 6 Sep 2024 08:51:31 +0100 Subject: [PATCH] Update PatchOperationMakeGunCECompatible.cs --- .../PatchOperationMakeGunCECompatible.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/CombatExtended/CombatExtended/PatchOperationMakeGunCECompatible.cs b/Source/CombatExtended/CombatExtended/PatchOperationMakeGunCECompatible.cs index 64c9ba9212..d32e4b7df8 100644 --- a/Source/CombatExtended/CombatExtended/PatchOperationMakeGunCECompatible.cs +++ b/Source/CombatExtended/CombatExtended/PatchOperationMakeGunCECompatible.cs @@ -17,6 +17,7 @@ public class PatchOperationMakeGunCECompatible : PatchOperation public XmlContainer AmmoUser; public XmlContainer FireModes; public XmlContainer weaponTags; + public XmlContainer weaponClasses; public XmlContainer costList; public XmlContainer researchPrerequisite; public XmlContainer attachmentLinks; @@ -67,6 +68,10 @@ public override bool ApplyWorker(XmlDocument xml) { AddOrReplaceCompsCE(xml, xmlNode); } + if (weaponClasses != null && weaponClasses.node.HasChildNodes) + { + AddOrReplaceWeaponClasses(xml, xmlNode); + } if (weaponTags != null && weaponTags.node.HasChildNodes) { AddOrReplaceWeaponTags(xml, xmlNode); @@ -212,6 +217,13 @@ private void AddOrReplaceCompsCE(XmlDocument xml, XmlNode xmlNode) comps.AppendChild(CreateListElementAndPopulate(xml, FireModes.node, "CombatExtended.CompProperties_FireModes")); } } + private void AddOrReplaceWeaponClasses(XmlDocument xml, XmlNode xmlNode) + { + XmlElement weaponClassesElement; + GetOrCreateNode(xml, xmlNode, "weaponClasses", out weaponClassesElement); + + Populate(xml, this.weaponClasses.node, ref weaponClassesElement); + } private void AddOrReplaceWeaponTags(XmlDocument xml, XmlNode xmlNode) {