Skip to content

Commit

Permalink
Remove unnecessary forceID condition check
Browse files Browse the repository at this point in the history
The conditional check for `forceID > 0` was removed, ensuring the `forceID` tag is always written to the XML. This simplifies the code and maintains consistency in data output.
  • Loading branch information
IllianiCBT committed Jan 25, 2025
1 parent f09ba0c commit addc8b3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions MekHQ/src/mekhq/campaign/unit/MothballInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
*/
package mekhq.campaign.unit;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import megamek.Version;
import megamek.logging.MMLogger;
import mekhq.campaign.Campaign;
import mekhq.campaign.personnel.Person;
import mekhq.utilities.MHQXMLUtility;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
* This class is used to store information about a particular unit that is
Expand Down Expand Up @@ -138,9 +137,7 @@ public void writeToXML(final PrintWriter pw, int indent) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "techId", tech.getId());
}

if (forceID > 0) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "forceID", forceID);
}
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "forceID", forceID);

for (Person driver : drivers) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "driverId", driver.getId());
Expand Down

0 comments on commit addc8b3

Please sign in to comment.