Skip to content

Commit 1115993

Browse files
authored
Merge pull request #6225 from IllianiCBT/brandNewSaving
Updated Part Saving to Always Save 'Brand New' Status
2 parents 04e475b + 74dc44c commit 1115993

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

MekHQ/src/mekhq/campaign/parts/Part.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,12 +617,7 @@ protected int writeToXMLBegin(final PrintWriter pw, int indent) {
617617
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "daysToArrival", daysToArrival);
618618
}
619619

620-
if (!brandNew) {
621-
// The default value for Part.brandNew is true. Only store the tag if the value
622-
// is false.
623-
// The lack of tag in the save file will ALWAYS result in TRUE.
624-
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "brandNew", false);
625-
}
620+
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "brandNew", brandNew);
626621
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "quantity", quantity);
627622

628623
if (daysToWait > 0) {
@@ -739,7 +734,7 @@ public static Part generateInstanceFromXML(Node wn, Version version) {
739734
} else if (wn2.getNodeName().equalsIgnoreCase("isTeamSalvaging")) {
740735
retVal.isTeamSalvaging = wn2.getTextContent().equalsIgnoreCase("true");
741736
} else if (wn2.getNodeName().equalsIgnoreCase("brandNew")) {
742-
retVal.brandNew = wn2.getTextContent().equalsIgnoreCase("true");
737+
retVal.brandNew = Boolean.parseBoolean(wn2.getTextContent().trim());
743738
} else if (wn2.getNodeName().equalsIgnoreCase("replacementId")) {
744739
retVal.replacementPart = new PartRef(Integer.parseInt(wn2.getTextContent()));
745740
} else if (wn2.getNodeName().equalsIgnoreCase("quality")) {

0 commit comments

Comments
 (0)