1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Return const RideObjectEntry*, refactor uses and fix related access

This commit is contained in:
ζeh Matt
2023-02-05 17:36:37 +02:00
parent 76b94a150c
commit a2a06d6dde
24 changed files with 153 additions and 161 deletions

View File

@@ -1505,7 +1505,7 @@ private:
for (; ObjectEntryGetChunk(ObjectType::Ride, entry_index) == nullptr; entry_index++)
;
RideObjectEntry* ride_entry = GetRideEntryByIndex(entry_index);
const auto* ride_entry = GetRideEntryByIndex(entry_index);
auto rideType = ride_entry->GetFirstNonNullRideType();
auto intent = Intent(WindowClass::TrackDesignList);
@@ -1586,7 +1586,7 @@ void EditorLoadSelectedObjects()
auto entryIndex = ObjectManagerGetLoadedObjectEntryIndex(loadedObject);
if (objectType == ObjectType::Ride)
{
RideObjectEntry* rideEntry = GetRideEntryByIndex(entryIndex);
const auto* rideEntry = GetRideEntryByIndex(entryIndex);
auto rideType = rideEntry->GetFirstNonNullRideType();
ResearchCategory category = static_cast<ResearchCategory>(GetRideTypeDescriptor(rideType).Category);
ResearchInsertRideEntry(rideType, entryIndex, category, true);