Skip to content

Commit

Permalink
Dropships in depth 1 water (center hex) are immobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
neoancient committed Sep 30, 2023
1 parent 9473794 commit 8f85486
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions megamek/src/megamek/common/Dropship.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*
Expand Down

0 comments on commit 8f85486

Please sign in to comment.