Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int max_height = H2I(TGPGetMaxHeight());
- /* Transfer height map into OTTD map */
- for (int y = 0; y < _height_map.size_y; y++) {
- for (int x = 0; x < _height_map.size_x; x++) {
- TgenSetTileHeight(TileXY(x, y), Clamp(H2I(_height_map.height(x, y)), 0, max_height));
- }
- }
- int tile_count = 0, cur_height = 0;
- while (tile_count < _height_map.size_x * _height_map.size_y * 2 / 3 && cur_height <= max_height) {
- for (int y = 0; y < _height_map.size_y; y++) {
- for (int x = 0; x < _height_map.size_x; x++) {
- if (GetTileZ(TileXY(x, y)) == cur_height) tile_count++;
- }
- }
- cur_height++;
- }
- if (_settings_game.game_creation.landscape == LT_ARCTIC) {
- _settings_game.game_creation.snow_line_height = Clamp(cur_height, MIN_SNOWLINE_HEIGHT, MAX_SNOWLINE_HEIGHT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement