Fix #10239: Use elevated snow height for roads on flat foundations (#12776)

This commit is contained in:
Tyler Trahan 2024-06-15 17:10:39 -04:00 committed by GitHub
parent d7137651f2
commit 4cbaac6dac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -1964,12 +1964,15 @@ static_assert(lengthof(_town_road_types_2) == HZB_END);
static void TileLoop_Road(TileIndex tile)
{
switch (_settings_game.game_creation.landscape) {
case LT_ARCTIC:
if (IsOnSnow(tile) != (GetTileZ(tile) > GetSnowLine())) {
case LT_ARCTIC: {
/* Roads on flat foundations use the snow level of the height they are elevated to. All others use the snow level of their minimum height. */
int tile_z = (std::get<Slope>(GetFoundationSlope(tile)) == SLOPE_FLAT) ? GetTileMaxZ(tile) : GetTileZ(tile);
if (IsOnSnow(tile) != (tile_z > GetSnowLine())) {
ToggleSnow(tile);
MarkTileDirtyByTile(tile);
}
break;
}
case LT_TROPIC:
if (GetTropicZone(tile) == TROPICZONE_DESERT && !IsOnDesert(tile)) {