From 706843e135ee985e70308b09c027b14172f7e31e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 15 Jun 2018 10:39:38 +0200 Subject: [PATCH] Use `get_ride_entry()` to build the correct `rct_research_item` --- src/openrct2/EditorObjectSelectionSession.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 4f686f08bf..3699ea091d 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -271,14 +271,16 @@ void editor_object_flags_free() * * rct2: 0x00685791 */ -static void remove_selected_objects_from_research(const rct_object_entry* installedObject){ +static void remove_selected_objects_from_research(const rct_object_entry* installedObject) +{ uint8 entry_type, entry_index; if (!find_object_in_entry_group(installedObject, &entry_type, &entry_index)) return; - if (entry_type == OBJECT_TYPE_RIDE){ - auto rideEntry = (rct_ride_entry *)object_entry_get_entry(entry_type, entry_index); - + if (entry_type == OBJECT_TYPE_RIDE) + { + auto rideEntry = get_ride_entry(entry_index); + for (auto rideType : rideEntry->ride_type) { rct_research_item tmp = {};