mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use CoordsXY on windows/Sign.cpp
This commit is contained in:
parent
fc860e8b6e
commit
1da24fed40
|
@ -214,9 +214,8 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||||
case WIDX_SIGN_DEMOLISH:
|
case WIDX_SIGN_DEMOLISH:
|
||||||
{
|
{
|
||||||
auto banner = GetBanner(w->number);
|
auto banner = GetBanner(w->number);
|
||||||
int32_t x = banner->position.x << 5;
|
auto bannerCoords = banner->position.ToCoordsXY();
|
||||||
int32_t y = banner->position.y << 5;
|
auto tile_element = map_get_first_element_at(bannerCoords);
|
||||||
auto tile_element = map_get_first_element_at({ x, y });
|
|
||||||
if (tile_element == nullptr)
|
if (tile_element == nullptr)
|
||||||
return;
|
return;
|
||||||
while (1)
|
while (1)
|
||||||
|
@ -235,7 +234,7 @@ static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sceneryRemoveAction = LargeSceneryRemoveAction(
|
auto sceneryRemoveAction = LargeSceneryRemoveAction(
|
||||||
{ x, y, tile_element->GetBaseZ(), tile_element->GetDirection() },
|
{ bannerCoords, tile_element->GetBaseZ(), tile_element->GetDirection() },
|
||||||
tile_element->AsLargeScenery()->GetSequenceIndex());
|
tile_element->AsLargeScenery()->GetSequenceIndex());
|
||||||
GameActions::Execute(&sceneryRemoveAction);
|
GameActions::Execute(&sceneryRemoveAction);
|
||||||
break;
|
break;
|
||||||
|
@ -458,9 +457,8 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex
|
||||||
case WIDX_SIGN_DEMOLISH:
|
case WIDX_SIGN_DEMOLISH:
|
||||||
{
|
{
|
||||||
auto banner = GetBanner(w->number);
|
auto banner = GetBanner(w->number);
|
||||||
int32_t x = banner->position.x << 5;
|
auto bannerCoords = banner->position.ToCoordsXY();
|
||||||
int32_t y = banner->position.y << 5;
|
auto tile_element = map_get_first_element_at(bannerCoords);
|
||||||
auto tile_element = map_get_first_element_at({ x, y });
|
|
||||||
if (tile_element == nullptr)
|
if (tile_element == nullptr)
|
||||||
return;
|
return;
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -476,7 +474,7 @@ static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex
|
||||||
}
|
}
|
||||||
tile_element++;
|
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);
|
auto wallRemoveAction = WallRemoveAction(wallLocation);
|
||||||
GameActions::Execute(&wallRemoveAction);
|
GameActions::Execute(&wallRemoveAction);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue