From a645067ddcbc7499f5307087aab725b664a17b03 Mon Sep 17 00:00:00 2001 From: psikomonkie <189469115+psikomonkie@users.noreply.github.com> Date: Sun, 15 Dec 2024 17:37:27 -0500 Subject: [PATCH] Issue 6264: Switched if to a Math.max --- megamek/src/megamek/common/verifier/TestInfantry.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/megamek/src/megamek/common/verifier/TestInfantry.java b/megamek/src/megamek/common/verifier/TestInfantry.java index 180fb924ae9..5d6afa3dbcc 100644 --- a/megamek/src/megamek/common/verifier/TestInfantry.java +++ b/megamek/src/megamek/common/verifier/TestInfantry.java @@ -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) {