From 4fcc86f9908b6f87db7d82842dfb7577511e21dd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Jan 2021 17:21:29 +0100 Subject: [PATCH] Fix #13236: New ride type appears as new vehicle type in research --- src/openrct2/management/Research.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index a1bf227d8a..4851472251 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -989,7 +989,7 @@ void research_determine_first_of_type() if (gResearchLastItem.has_value() && !gResearchLastItem->IsNull() && researchItem.Equals(&gResearchLastItem.value())) continue; - // The next research item is also present in gResearchItemsInvented, even though it isn't invented yet(!) + // The next research item is (sometimes?) also present in gResearchItemsInvented, even though it isn't invented yet(!) if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem.Equals(&gResearchNextItem.value())) continue; @@ -1009,6 +1009,14 @@ void research_determine_first_of_type() for (auto& researchItem : gResearchItemsUninvented) { + // The next research item is (sometimes?) also present in gResearchItemsUninvented + if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() && researchItem.Equals(&gResearchNextItem.value())) + { + // Copy the "first of type" flag. + researchItem.flags = gResearchNextItem->flags; + continue; + } + research_update_first_of_type(&researchItem); } }