mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move uninvented item to invented list when research is complete
When an item began initial research, it was moved to the invented list. This is not intuitive for plugins, so move it once the item is fully researched.
This commit is contained in:
parent
fe3f32e82e
commit
00eb2aae95
|
@ -164,17 +164,25 @@ static void ResearchNextDesign()
|
|||
it = gResearchItemsUninvented.begin();
|
||||
}
|
||||
|
||||
const ResearchItem researchItem = *it;
|
||||
gResearchNextItem = researchItem;
|
||||
gResearchNextItem = *it;
|
||||
gResearchProgress = 0;
|
||||
gResearchProgressStage = RESEARCH_STAGE_DESIGNING;
|
||||
|
||||
gResearchItemsUninvented.erase(it);
|
||||
gResearchItemsInvented.push_back(researchItem);
|
||||
|
||||
ResearchInvalidateRelatedWindows();
|
||||
}
|
||||
|
||||
static void MarkResearchItemInvented(const ResearchItem& researchItem)
|
||||
{
|
||||
gResearchItemsUninvented.erase(
|
||||
std::remove(gResearchItemsUninvented.begin(), gResearchItemsUninvented.end(), researchItem),
|
||||
gResearchItemsUninvented.end());
|
||||
|
||||
if (std::find(gResearchItemsInvented.begin(), gResearchItemsInvented.end(), researchItem) == gResearchItemsInvented.end())
|
||||
{
|
||||
gResearchItemsInvented.push_back(researchItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006848D4
|
||||
|
@ -346,6 +354,7 @@ void ResearchUpdate()
|
|||
ResearchInvalidateRelatedWindows();
|
||||
break;
|
||||
case RESEARCH_STAGE_COMPLETING_DESIGN:
|
||||
MarkResearchItemInvented(*gResearchNextItem);
|
||||
ResearchFinishItem(*gResearchNextItem);
|
||||
gResearchProgress = 0;
|
||||
gResearchProgressStage = RESEARCH_STAGE_INITIAL_RESEARCH;
|
||||
|
|
|
@ -139,7 +139,6 @@ void ResearchInsertRideEntry(ObjectEntryIndex entryIndex, bool researched);
|
|||
bool ResearchInsertSceneryGroupEntry(ObjectEntryIndex entryIndex, bool researched);
|
||||
|
||||
bool ResearchIsInvented(ObjectType objectType, ObjectEntryIndex index);
|
||||
bool ResearchSetInvented(ObjectType objectType, ObjectEntryIndex index, bool value);
|
||||
void RideTypeSetInvented(uint32_t rideType);
|
||||
void RideEntrySetInvented(ObjectEntryIndex rideEntryIndex);
|
||||
void ScenerySetInvented(const ScenerySelection& sceneryItem);
|
||||
|
|
Loading…
Reference in New Issue