From 8e8474c400a6b673edbe5ccaacdf35b33115fdf5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 28 May 2016 09:30:31 +0100 Subject: [PATCH] Modify object selection to only research selected item when adding new objects during a game. (#3762) --- src/windows/editor_object_selection.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index a718fc1a6c..3d74519d74 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -775,8 +775,7 @@ static void window_editor_object_selection_close(rct_window *w) } else { // Used for in-game object selection cheat - research_reset_items(); - research_populate_list_researched(); + // This resets the ride selection list and resets research to 0 on current item gSilentResearch = true; sub_684AC3(); gSilentResearch = false; @@ -1986,6 +1985,20 @@ static void editor_load_selected_objects() if (!object_load_chunk(-1, installed_entry, &chunk_size)) { log_error("Failed to load entry %.8s", installed_entry->name); } + + // For in game use (cheat) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { + // Defaults selected items to researched. + if (find_object_in_entry_group(installed_entry, &entry_type, &entry_index)) { + if (entry_type == OBJECT_TYPE_RIDE) { + rct_ride_entry* rideType = get_ride_entry(entry_index); + research_insert(1, 0x10000 | (rideType->ride_type[0] << 8) | entry_index, rideType->category[0]); + } + else if (entry_type == OBJECT_TYPE_SCENERY_SETS) { + research_insert(1, entry_index, RESEARCH_CATEGORY_SCENERYSET); + } + } + } } }