Introduce calls to check for research markers

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2018-06-15 12:11:03 +02:00
1 parent aad1e69d7e
commit d28e8a6126
3 files changed
+20 -1

No files matched your search

+15
View File
@@ -1015,3 +1015,18 @@ bool research_item_is_always_researched(rct_research_item * researchItem)
{
return (researchItem->flags & (RESEARCH_ENTRY_FLAG_RIDE_ALWAYS_RESEARCHED | RESEARCH_ENTRY_FLAG_SCENERY_SET_ALWAYS_RESEARCHED)) != 0;
}
bool rct_research_item::IsInventedEndMarker() const
{
return rawValue == RESEARCHED_ITEMS_SEPARATOR;
}
bool rct_research_item::IsUninventedEndMarker() const
{
return rawValue == RESEARCHED_ITEMS_END;
}
bool rct_research_item::IsRandomEndMarker() const
{
return rawValue == RESEARCHED_ITEMS_END_2;
}
+4
View File
@@ -38,6 +38,10 @@ struct rct_research_item
};
};
uint8 category;
bool IsInventedEndMarker() const;
bool IsRandomEndMarker() const;
bool IsUninventedEndMarker() const;
};
assert_struct_size(rct_research_item, 5);
#pragma pack(pop)
+1 -1
View File
@@ -2123,7 +2123,7 @@ private:
gResearchExpectedMonth = _s4.next_research_expected_month;
ConvertResearchEntry(&gResearchNextItem, _s4.next_research_item, _s4.next_research_type);
if (gResearchNextItem.rawValue == RESEARCHED_ITEMS_SEPARATOR)
if (gResearchNextItem.IsInventedEndMarker())
{
gResearchProgressStage = RESEARCH_STAGE_INITIAL_RESEARCH;
gResearchProgress = 0;