Skip to content

Commit 639c553

Browse files
authored
Issue 7953 - enable units to go on height 0 bridges again (#7997)
Fixes #7953
2 parents 5efcad7 + cb8d32c commit 639c553

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

megamek/src/megamek/common/units/Entity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,10 @@ public boolean isElevationValid(int assumedElevation, Hex hex) {
27032703
int bridgeElev = hex.terrainLevel(Terrains.BRIDGE_ELEV);
27042704
// Entity fits under if: elevation + height + 1 <= bridge elevation
27052705
// (matches VTOL check logic at lines 2599-2602)
2706-
if (assumedElevation + height() + 1 > bridgeElev) {
2706+
// don't check this for units that are not actually below the bridge, including units on a height
2707+
// 0 bridge on dry ground (essentially, the bridge being a road)
2708+
// but: don't forget that a height 0 bridge can be over water where this is relevant
2709+
if (assumedElevation < bridgeElev && assumedElevation + height() + 1 > bridgeElev) {
27072710
return false; // Can't fit under bridge, floor is invalid
27082711
}
27092712
}

0 commit comments

Comments
 (0)