From c74339fed90f6f4235ffe7e2a71074f35d9879cf Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 31 Dec 2019 08:15:46 +0000 Subject: [PATCH] Fix #10477. Fix upper max height limit being very low for large scenery Mistake made while improving mouse control when zoomed out caused the upper limit for multi tile scenery to be limited by the sum of all clearance z values instead of the greatest clearance z value. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TopToolbar.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 467df47731..585b0fa841 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -8,6 +8,7 @@ - Fix: [#10228] Can't import RCT1 Deluxe from Steam. - Fix: [#10325] Crash when banners have no text. - Fix: [#10420] Money effect causing false positive desync. +- Fix: [#10477] Large Scenery cannot be placed higher using SHIFT. 0.2.4 (2019-10-28) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index ce7f62fefd..c5a42a2076 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1250,13 +1250,12 @@ static void sub_6E1F34( rct_scenery_entry* scenery_entry = get_large_scenery_entry(selected_scenery); if (scenery_entry) { - int16_t tileZ = 0; + int16_t maxClearZ = 0; for (int32_t i = 0; scenery_entry->large_scenery.tiles[i].x_offset != -1; ++i) { - assert(i < MAXIMUM_MAP_SIZE_TECHNICAL); - tileZ += scenery_entry->large_scenery.tiles[i].z_clearance; + maxClearZ = std::max(maxClearZ, scenery_entry->large_scenery.tiles[i].z_clearance); } - maxPossibleHeight = std::max(0, maxPossibleHeight - tileZ); + maxPossibleHeight = std::max(0, maxPossibleHeight - maxClearZ); } can_raise_item = true; }