From 8f85486248f8dec7f14bc2d00c0cb5ad0f8b9ac2 Mon Sep 17 00:00:00 2001 From: cwspain Date: Sat, 30 Sep 2023 17:50:23 -0500 Subject: [PATCH] Dropships in depth 1 water (center hex) are immobile. --- megamek/src/megamek/common/Dropship.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/megamek/src/megamek/common/Dropship.java b/megamek/src/megamek/common/Dropship.java index 36b3b8bbb31..c04f709f116 100644 --- a/megamek/src/megamek/common/Dropship.java +++ b/megamek/src/megamek/common/Dropship.java @@ -474,6 +474,18 @@ public int height() { return 4; } + @Override + public int getWalkMP(MPCalculationSetting mpCalculationSetting) { + // A grounded dropship with the center hex in level 1 water is immobile. + if ((game != null) && !game.getBoard().inSpace() && !isAirborne()) { + Hex hex = game.getBoard().getHex(getPosition()); + if ((hex != null) && (hex.containsTerrain(Terrains.WATER, 1) && !hex.containsTerrain(Terrains.ICE))) { + return 0; + } + } + return super.getWalkMP(mpCalculationSetting); + } + /* * (non-Javadoc) *