Skip to content

Commit

Permalink
Merge pull request #5078 from IllianiCBT/spa_skillRequirements
Browse files Browse the repository at this point in the history
Re-Added Compatibility Handlers for SPA Skill Prerequisites
  • Loading branch information
HammerGS authored Oct 21, 2024
2 parents 84d7c7a + f2f6fcd commit b0c4148
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MekHQ/src/mekhq/campaign/personnel/SkillPerquisite.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ public static SkillPerquisite generateInstanceFromXML(Node wn) {
Node wn2 = nl.item(x);
if (wn2.getNodeName().equalsIgnoreCase("skill")) {
String skillName = wn2.getTextContent();

// <50.01 compatibility handlers
skillName = skillName.replaceAll("Piloting/Mech::", "Piloting/Mek::");
skillName = skillName.replaceAll("Gunnery/Mech::", "Gunnery/Mek::");
skillName = skillName.replaceAll("Gunnery/Battlesuit::", "Gunnery/BattleArmor::");
skillName = skillName.replaceAll("Gunnery/ProtoMech::", "Gunnery/ProtoMek::");
skillName = skillName.replaceAll("Anti-Mech::", "Anti-Mek::");
skillName = skillName.replaceAll("Tech/Mech::", "Tech/Mek::");
skillName = skillName.replaceAll("Tech/BA::", "Tech/BattleArmor::");
skillName = skillName.replaceAll("Medtech::", "MedTech::");
// end compatibility handlers

int level = 0;
if (skillName.contains("::")) {
level = parseStringForLevel(skillName);
Expand Down

0 comments on commit b0c4148

Please sign in to comment.