Skip to content

Commit

Permalink
Fix #21870: Demolishing flat ride in pause mode allows copies
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Apr 30, 2024
1 parent 575cd75 commit 44c442f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Change: [#21855] Cheats menu dropdown no longer requires dragging.
- Fix: [#866] Boat Hire boats get stuck entering track.
- Fix: [#10701] No reason specified when placing door over unsuitable track.
- Fix: [#18723, #21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies.
- Fix: [#19559] Custom rides with long descriptions extend into lower widgets.
- Fix: [#21696] Fullscreen window option not correctly applied on macOS.
- Fix: [#21787] Map generator heightmap should respect increased height limits.
Expand Down
15 changes: 7 additions & 8 deletions src/openrct2-ui/windows/RideConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2357,14 +2357,6 @@ static Widget _rideConstructionWidgets[] = {
const PreviewTrack* trackBlock = ted.Block;
newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z;
_gotoStartPlacementMode = true;

// When flat rides are deleted, the window should be reset so the currentRide can be placed again.
auto currentRide = GetRide(_currentRideIndex);
const auto& rtd = currentRide->GetRideTypeDescriptor();
if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY))
{
RideInitialiseConstructionWindow(*currentRide);
}
}

auto trackRemoveAction = TrackRemoveAction(
Expand All @@ -2381,6 +2373,13 @@ static Widget _rideConstructionWidgets[] = {
auto currentRide = GetRide(_currentRideIndex);
if (currentRide != nullptr)
{
// When flat rides are deleted, the window should be reset so the currentRide can be placed again.
const auto& rtd = currentRide->GetRideTypeDescriptor();
if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY))
{
RideInitialiseConstructionWindow(*currentRide);
}

WindowRideConstructionMouseUpDemolishNextPiece({ *newCoords, static_cast<Direction>(direction) }, type);
}
}
Expand Down

0 comments on commit 44c442f

Please sign in to comment.