forked from rosebudai/OpenRCT2-Web
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.
This commit is contained in:
1 parent
2272d965d8
commit
957d5a9735
1 file changed
+5
-4
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user