1
0
Fork 0

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

pull/12776/head
Tyler Trahan 2024-06-11 10:06:48 -04:00
parent 4cf6d1dd79
commit b914d73063
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)) {