diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4d6ff4baca..6ccf4c85c5 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -8,6 +8,7 @@ - Fix: [#26352] Large scenery items are incorrectly labelled as 'banners' in the tile inspector. - Fix: [#26352] The label for path additions is using the wrong text colour in the tile inspector. - Fix: [#26360] Inverted Lay-down Roller Coaster helices are invisible when loading old saves. +- Fix: [#26410] Tiles with water can draw incorrectly when there is something underwater and nothing above water. 0.5.0 (2026-04-12) ------------------------------------------------------------------------ diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 263f65bf54..9c10b69a35 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -188,19 +188,17 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor if (screenMinY + 52 <= session.rt.WorldY()) return; - const TileElement* element = tile_element; // push tile_element - uint16_t maxHeight = 0; - do { - maxHeight = std::max(maxHeight, static_cast(element->GetClearanceZ())); - } while (!(element++)->IsLastForTile()); - - element--; - - if (element->GetType() == TileElementType::Surface && (element->AsSurface()->GetWaterHeight() > 0)) - { - maxHeight = std::max(maxHeight, static_cast(element->AsSurface()->GetWaterHeight())); + const TileElement* element = tile_element; + do + { + maxHeight = std::max(maxHeight, static_cast(element->GetClearanceZ())); + if (element->GetType() == TileElementType::Surface) + { + maxHeight = std::max(maxHeight, static_cast(element->AsSurface()->GetWaterHeight())); + } + } while (!(element++)->IsLastForTile()); } if (partOfVirtualFloor)