1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 08:12:53 +01:00

Use switch for Ride::UpdateAll

This commit is contained in:
Tulio Leao
2020-12-23 20:15:39 -03:00
parent af0ec60bed
commit 8c9fa45a76

View File

@@ -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;
}