From a1d35ec33d795149616dd494faa5ef43e8a23bc6 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 30 Oct 2022 16:59:06 +0100 Subject: [PATCH] Fix #18459: 'Highlight path issues' hides fences --- distribution/changelog.txt | 1 + .../paint/tile_element/Paint.Path.cpp | 23 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 176c0ddc4b..9dbaaa0ed1 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -27,6 +27,7 @@ - Fix: [#18442] About window background is clickable. - Fix: [#18449] [Plugin] Change type of listview widgets from 'scroll_view' to 'listview'. - Fix: [#18453] Slow walking guests don't get across level crossings in time. +- Fix: [#18459] ‘Highlight path issues’ hides fences for paths with additions. 0.4.2 (2022-10-05) ------------------------------------------------------------------------ diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 6c948017a4..60af734f4a 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -729,8 +729,6 @@ static void sub_6A3F61( if (dpi->zoom_level <= ZoomLevel{ 1 }) { - bool paintScenery = true; - if (!gTrackDesignSaveMode) { if (pathElement.HasAddition()) @@ -743,19 +741,16 @@ static void sub_6A3F61( // Draw additional path bits (bins, benches, lamps, queue screens) auto* pathAddEntry = pathElement.GetAdditionEntry(); - + bool drawAddition = true; // Can be null if the object is not loaded. - if (pathAddEntry == nullptr) + if (pathAddEntry == nullptr + || ((session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(pathElement.IsBroken()) + && pathAddEntry->draw_type != PathBitDrawType::Bin)) { - paintScenery = false; + drawAddition = false; } - else if ( - (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(pathElement.IsBroken()) - && pathAddEntry->draw_type != PathBitDrawType::Bin) - { - paintScenery = false; - } - else + + if (drawAddition) { switch (pathAddEntry->draw_type) { @@ -791,9 +786,7 @@ static void sub_6A3F61( // Redundant zoom-level check removed - if (paintScenery) - PathPaintFencesAndQueueBanners( - session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo, imageTemplate); + PathPaintFencesAndQueueBanners(session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo, imageTemplate); } // This is about tunnel drawing