From ca605d6f82bc758a15a16906d6b73009084de40c Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Mon, 2 Aug 2021 09:07:53 +0300 Subject: [PATCH] Refactor object selection to use RideManager --- src/openrct2/EditorObjectSelectionSession.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 622262fe06..bafce4fc47 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -192,14 +192,10 @@ void setup_in_use_selection_flags() } } while (tile_element_iterator_next(&iter)); - for (ride_id_t ride_index = 0; ride_index < MAX_RIDES; ride_index++) + for (auto& ride : GetRideManager()) { - auto ride = get_ride(ride_index); - if (ride != nullptr) - { - ObjectEntryIndex type = ride->subtype; - Editor::SetSelectedObject(ObjectType::Ride, type, OBJECT_SELECTION_FLAG_SELECTED); - } + ObjectEntryIndex type = ride.subtype; + Editor::SetSelectedObject(ObjectType::Ride, type, OBJECT_SELECTION_FLAG_SELECTED); } // Apply selected object status for hacked vehicles that may not have an associated ride