Fix #13236: New ride type appears as new vehicle type in research

This commit is contained in:
Gymnasiast 2021-01-15 17:21:29 +01:00
parent 5cd3014334
commit 4fcc86f990
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
1 changed files with 9 additions and 1 deletions

View File

@ -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);
}
}