Skip to content

Commit

Permalink
Issue 6264: Switched if to a Math.max
Browse files Browse the repository at this point in the history
  • Loading branch information
psikomonkie committed Dec 15, 2024
1 parent 6e22374 commit a645067
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions megamek/src/megamek/common/verifier/TestInfantry.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,8 @@ public static double getWeightExact(Infantry infantry, CalculationReport report)
report.addEmptyLine();

InfantryMount mount = infantry.getMount();
int activeTroopers = infantry.getInternal(Infantry.LOC_INFANTRY);
if (activeTroopers < 0) {
activeTroopers = 0;
}
int activeTroopers = Math.max(0, infantry.getInternal(Infantry.LOC_INFANTRY));

double weight;

if (mount != null) {
Expand Down

0 comments on commit a645067

Please sign in to comment.