Skip to content

Commit

Permalink
Merge pull request #3403 from CombatExtended-Continued/PatchOpsInclud…
Browse files Browse the repository at this point in the history
…eWeaponClass

Add WeaponClass in PatchOpsMakeGunCompat
  • Loading branch information
N7Huntsman authored Sep 8, 2024
2 parents fe16157 + ef42b24 commit bfb11ae
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit bfb11ae

Please sign in to comment.