From 4fcc86f9908b6f87db7d82842dfb7577511e21dd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Jan 2021 17:21:29 +0100 Subject: [PATCH 1/3] 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); } } From 19d113ae86f127bc6e0d41365335df89520c57ad Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Jan 2021 17:34:47 +0100 Subject: [PATCH 2/3] Reduce code duplication --- src/openrct2/management/Research.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 4851472251..54a3997204 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -954,8 +954,6 @@ static void research_update_first_of_type(ResearchItem* researchItem) if (!_seenRideType[rideType]) researchItem->flags |= RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE; - - _seenRideType[rideType] = true; } static void research_mark_ride_type_as_seen(const ResearchItem& researchItem) @@ -1018,5 +1016,6 @@ void research_determine_first_of_type() } research_update_first_of_type(&researchItem); + research_mark_ride_type_as_seen(researchItem); } } From f95e98d9d8e489a2e6be7be46283d164ebc59ddd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 15 Jan 2021 17:35:51 +0100 Subject: [PATCH 3/3] Add #13236 to changelog --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 240757135c..7dfb201fab 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -22,6 +22,7 @@ - Fix: [#9631, #10716] Banners drawing glitches when there are more than 32 on the screen at once. - Fix: [#12895] Mechanics are called to repair rides that have already been fixed. - Fix: [#13102] Underflow on height chart (Ride measurements). +- Fix: [#13236] New ride type appears as new vehicle type in research. - Fix: [#13257] Rides that are exactly the minimum objective length are not counted. - Fix: [#13334] Uninitialised variables in CustomTabDesc. - Fix: [#13342] Rename tabChange to onTabChange in WindowDesc interface.