mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 18:32:35 +01:00
Add: Show height difference in bridge is too low error message. (#14614)
This commit is contained in:
@@ -891,7 +891,10 @@ static CommandCost IsStationBridgeAboveOk(TileIndex tile, std::span<const Bridge
|
||||
/* Get normal error message associated with clearing the tile. */
|
||||
return Command<CMD_LANDSCAPE_CLEAR>::Do(DoCommandFlag::Auto, tile);
|
||||
}
|
||||
if (GetTileMaxZ(tile) + height > bridge_height) return CommandCost{GetBridgeTooLowMessageForStationType(type)};
|
||||
if (GetTileMaxZ(tile) + height > bridge_height) {
|
||||
int height_diff = (GetTileMaxZ(tile) + height - bridge_height) * TILE_HEIGHT_STEP;
|
||||
return CommandCostWithParam(GetBridgeTooLowMessageForStationType(type), height_diff);
|
||||
}
|
||||
|
||||
return CommandCost{};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user