Skip to content

Commit

Permalink
Merge pull request #13841 from Gymnasiast/fix/13236
Browse files Browse the repository at this point in the history
Fix #13236: New ride type appears as new vehicle type in research
  • Loading branch information
Gymnasiast committed Jan 15, 2021
2 parents 32d8dad + f95e98d commit 12edd61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Expand Up @@ -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.
Expand Down
13 changes: 10 additions & 3 deletions src/openrct2/management/Research.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -989,7 +987,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;

Expand All @@ -1009,6 +1007,15 @@ 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);
research_mark_ride_type_as_seen(researchItem);
}
}

0 comments on commit 12edd61

Please sign in to comment.