1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Do force close in RideClearForConstruction instead, to cover all cases

This commit is contained in:
Kyphii
2025-10-06 19:11:29 -04:00
parent 11e490a56d
commit c02a41b6ae
2 changed files with 6 additions and 7 deletions

View File

@@ -169,13 +169,6 @@ namespace OpenRCT2::GameActions
RideClearForConstruction(*ride);
ride->removePeeps();
if (ride->status == RideStatus::simulating)
{
// Also close the ride
auto gameAction = GameActions::RideSetStatusAction(ride->id, RideStatus::closed);
ExecuteNested(&gameAction, gameState);
}
ride->mode = static_cast<RideMode>(_value);
ride->updateMaxVehicles();
ride->updateNumberOfCircuits();

View File

@@ -236,6 +236,12 @@ void RideClearForConstruction(Ride& ride)
ride.removeVehicles();
RideClearBlockedTiles(ride);
// Force close simulating rides, to reset flag widget in Construction UI
if (ride.status == RideStatus::simulating)
{
ride.status = RideStatus::closed;
}
auto* windowMgr = Ui::GetWindowManager();
auto w = windowMgr->FindByNumber(WindowClass::ride, ride.id.ToUnderlying());
if (w != nullptr)