From 957d5a9735ed3c941fb2e3c859ebfddcd32900db Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Mon, 29 Feb 2016 22:02:03 +0000 Subject: [PATCH] Fix #2324. Inventions list changes no longer break scenery window. Issue was caused by the invention list flags being passed into the finish research function and interpreting always researched scenery sets as rides. This could also cause crashes if there were more scenery sets than rides researched. --- src/windows/editor_inventions_list.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/windows/editor_inventions_list.c b/src/windows/editor_inventions_list.c index 0c98c51f4a..c35aee7efd 100644 --- a/src/windows/editor_inventions_list.c +++ b/src/windows/editor_inventions_list.c @@ -285,8 +285,9 @@ static void research_always_researched_setup() /** * * rct2: 0x00685A79 + * Do not use the research list outside of the inventions list window with the flags */ -static void sub_685A79() +static void research_remove_flags() { for (rct_research_item* research = gResearchItems; research->entryIndex != RESEARCHED_ITEMS_END_2; @@ -556,15 +557,15 @@ void window_editor_inventions_list_open() * rct2: 0x006853D2 */ static void window_editor_inventions_list_close(rct_window *w) -{ +{ + research_remove_flags(); + // When used in-game (as a cheat) if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_EDITOR)) { gSilentResearch = true; sub_684AC3(); gSilentResearch = false; } - - sub_685A79(); } /**