From 1da24fed40acbc126170521d665ea4a8e9681b00 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Fri, 1 May 2020 12:19:20 -0300 Subject: [PATCH] Use CoordsXY on windows/Sign.cpp --- src/openrct2-ui/windows/Sign.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index c0748a0da7..914c2caa89 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -214,9 +214,8 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex) case WIDX_SIGN_DEMOLISH: { auto banner = GetBanner(w->number); - int32_t x = banner->position.x << 5; - int32_t y = banner->position.y << 5; - auto tile_element = map_get_first_element_at({ x, y }); + auto bannerCoords = banner->position.ToCoordsXY(); + auto tile_element = map_get_first_element_at(bannerCoords); if (tile_element == nullptr) return; while (1) @@ -235,7 +234,7 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex) } auto sceneryRemoveAction = LargeSceneryRemoveAction( - { x, y, tile_element->GetBaseZ(), tile_element->GetDirection() }, + { bannerCoords, tile_element->GetBaseZ(), tile_element->GetDirection() }, tile_element->AsLargeScenery()->GetSequenceIndex()); GameActions::Execute(&sceneryRemoveAction); break; @@ -458,9 +457,8 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex case WIDX_SIGN_DEMOLISH: { auto banner = GetBanner(w->number); - int32_t x = banner->position.x << 5; - int32_t y = banner->position.y << 5; - auto tile_element = map_get_first_element_at({ x, y }); + auto bannerCoords = banner->position.ToCoordsXY(); + auto tile_element = map_get_first_element_at(bannerCoords); if (tile_element == nullptr) return; while (true) @@ -476,7 +474,7 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex } tile_element++; } - CoordsXYZD wallLocation = { x, y, tile_element->GetBaseZ(), tile_element->GetDirection() }; + CoordsXYZD wallLocation = { bannerCoords, tile_element->GetBaseZ(), tile_element->GetDirection() }; auto wallRemoveAction = WallRemoveAction(wallLocation); GameActions::Execute(&wallRemoveAction); break;