Fix tiles mistakenly culled when elements below water and none above (#26410)

This commit is contained in:
mix
2026-04-22 08:03:47 +01:00
committed by GitHub
parent 5e7888b672
commit e2b324cc0e
2 changed files with 10 additions and 11 deletions
+1
View File
@@ -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)
------------------------------------------------------------------------
@@ -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<uint16_t>(element->GetClearanceZ()));
} while (!(element++)->IsLastForTile());
element--;
if (element->GetType() == TileElementType::Surface && (element->AsSurface()->GetWaterHeight() > 0))
{
maxHeight = std::max(maxHeight, static_cast<uint16_t>(element->AsSurface()->GetWaterHeight()));
const TileElement* element = tile_element;
do
{
maxHeight = std::max(maxHeight, static_cast<uint16_t>(element->GetClearanceZ()));
if (element->GetType() == TileElementType::Surface)
{
maxHeight = std::max(maxHeight, static_cast<uint16_t>(element->AsSurface()->GetWaterHeight()));
}
} while (!(element++)->IsLastForTile());
}
if (partOfVirtualFloor)