Fix bug introduced after empty vector check

This commit is contained in:
Gymnasiast 2019-08-23 22:52:13 +02:00
parent ae8c93ca2b
commit ad96aa5785
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
1 changed files with 12 additions and 6 deletions

View File

@ -125,6 +125,16 @@ static void research_invalidate_related_windows()
window_invalidate_by_class(WC_RESEARCH);
}
static void research_mark_as_fully_completed()
{
gResearchProgress = 0;
gResearchProgressStage = RESEARCH_STAGE_FINISHED_ALL;
research_invalidate_related_windows();
// Reset funding to 0 if no more rides.
auto gameAction = ParkSetResearchFundingAction(gResearchPriorities, 0);
GameActions::Execute(&gameAction);
}
/**
*
* rct2: 0x00684BE5
@ -133,6 +143,7 @@ static void research_next_design()
{
if (gResearchItemsUninvented.empty())
{
research_mark_as_fully_completed();
return;
}
@ -153,12 +164,7 @@ static void research_next_design()
}
else
{
gResearchProgress = 0;
gResearchProgressStage = RESEARCH_STAGE_FINISHED_ALL;
research_invalidate_related_windows();
// Reset funding to 0 if no more rides.
auto gameAction = ParkSetResearchFundingAction(gResearchPriorities, 0);
GameActions::Execute(&gameAction);
research_mark_as_fully_completed();
return;
}
}