// Is there a building to "catch" the unit?
if (nextHex.containsTerrain(Terrains.BLDG_ELEV)) {
// unit will land on the roof, if at a higher level,
// otherwise it will skid through the wall onto the same
// floor.
nextAltitude = Math.min(curAltitude, nextHex.getElevation() + nextHex.terrainLevel(Terrains.BLDG_ELEV));
}
// Is there a bridge to "catch" the unit?
if (nextHex.containsTerrain(Terrains.BRIDGE)) {
// unit will land on the bridge, if at a higher level,
// and the bridge exits towards the current hex,