From 9d0754dd3920e1ebf2c47ce7e1a365ed3f745ff2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 13 Jan 2023 18:54:11 +0100 Subject: [PATCH] Errata: Minimum 1 crits and 1t weight for Mek MASC --- megamek/src/megamek/common/MiscType.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/megamek/src/megamek/common/MiscType.java b/megamek/src/megamek/common/MiscType.java index 6c822dc48ae..5c41ce179ef 100644 --- a/megamek/src/megamek/common/MiscType.java +++ b/megamek/src/megamek/common/MiscType.java @@ -559,7 +559,7 @@ public double getTonnage(Entity entity, int location, double size, RoundWeight d return defaultRounding.round(e.getWeightEngine(entity, defaultRounding) / 10.0, entity); } - return RoundWeight.nearestTon(entity.getWeight() * (isClan() ? 0.04 : 0.05)); + return Math.max(RoundWeight.nearestTon(entity.getWeight() * (isClan() ? 0.04 : 0.05)), 1); } } else if (hasFlag(F_QUAD_TURRET) || hasFlag(F_SHOULDER_TURRET) || hasFlag(F_HEAD_TURRET)) { // Turrets weight 10% of the weight of equipment in them, not counting Heat Sinks, Ammo and Armor @@ -1085,9 +1085,9 @@ public int getCriticals(Entity entity, double size) { return 1 + (int) Math.ceil(entity.getWeight() / 20.0); } else if (hasFlag(F_MASC)) { if (TechConstants.isClan(getTechLevel(entity.getTechLevelYear()))) { - return (int) Math.round(entity.getWeight() / 25.0); + return Math.max((int) Math.round(entity.getWeight() / 25.0), 1); } - return (int) Math.round(entity.getWeight() / 20.0); + return Math.max((int) Math.round(entity.getWeight() / 20.0), 1); } else if ((entity instanceof Aero) && (hasFlag(F_REACTIVE) || hasFlag(F_REFLECTIVE) || hasFlag(F_ANTI_PENETRATIVE_ABLATIVE)