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:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user