Skip to content

Commit

Permalink
Use switch for Ride::UpdateAll
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal committed Dec 23, 2020
1 parent af0ec60 commit 8c9fa45
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/openrct2/ride/Ride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1984,9 +1984,22 @@ void Ride::UpdateAll()
// Remove all rides if scenario editor
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
{
if (EnumValue(gS6Info.editor_step) <= EnumValue(EditorStep::InventionsListSetUp))
for (auto& ride : GetRideManager())
ride.Delete();
switch (gS6Info.editor_step)
{
case EditorStep::ObjectSelection:
case EditorStep::LandscapeEditor:
case EditorStep::InventionsListSetUp:
for (auto& ride : GetRideManager())
ride.Delete();
break;
case EditorStep::OptionsSelection:
case EditorStep::ObjectiveSelection:
case EditorStep::SaveScenario:
case EditorStep::RollercoasterDesigner:
case EditorStep::DesignsManager:
case EditorStep::Invalid:
break;
}
return;
}

Expand Down

0 comments on commit 8c9fa45

Please sign in to comment.