From 114bed4549a632db4bd740d82452fe71afa5e783 Mon Sep 17 00:00:00 2001 From: Andreas Schmitt Date: Fri, 29 Apr 2022 15:31:23 +0200 Subject: [PATCH] Fix z-check for flat road foundations --- src/road_cmd.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index d112bf259a..9e53752f1c 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -2478,9 +2478,14 @@ static void TileLoop_Road(TileIndex tile) { switch (_settings_game.game_creation.landscape) { case LT_ARCTIC: - if (IsOnSnow(tile) != (GetTileZ(tile) > GetSnowLine())) { - ToggleSnow(tile); - MarkTileDirtyByTile(tile); + { + /* Flat foundation tiles should look the same as the tiles they visually connect to. */ + int tile_z = GetFoundationSlope(tile) == SLOPE_FLAT ? GetTileMaxZ(tile) : GetTileZ(tile); + + if (IsOnSnow(tile) != (tile_z > GetSnowLine())) { + ToggleSnow(tile); + MarkTileDirtyByTile(tile); + } } break;