mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Merge pull request #15581 from Gymnasiast/refactor/research_remove
Make research_remove take const ref
This commit is contained in:
@@ -155,7 +155,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex)
|
||||
w->Invalidate();
|
||||
}
|
||||
|
||||
research_remove(&_editorInventionsListDraggedItem);
|
||||
ResearchRemove(_editorInventionsListDraggedItem);
|
||||
|
||||
auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented;
|
||||
if (beforeItem != nullptr)
|
||||
|
||||
@@ -318,7 +318,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip
|
||||
tmp.type = Research::EntryType::Ride;
|
||||
tmp.entryIndex = entryIndex;
|
||||
tmp.baseRideType = rideType;
|
||||
research_remove(&tmp);
|
||||
ResearchRemove(tmp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -327,7 +327,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip
|
||||
ResearchItem tmp = {};
|
||||
tmp.type = Research::EntryType::Scenery;
|
||||
tmp.entryIndex = entryIndex;
|
||||
research_remove(&tmp);
|
||||
ResearchRemove(tmp);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -415,12 +415,12 @@ static void research_insert_researched(ResearchItem&& item)
|
||||
*
|
||||
* rct2: 0x006857CF
|
||||
*/
|
||||
void research_remove(ResearchItem* researchItem)
|
||||
void ResearchRemove(const ResearchItem& researchItem)
|
||||
{
|
||||
for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++)
|
||||
{
|
||||
auto& researchItem2 = *it;
|
||||
if (researchItem2 == *researchItem)
|
||||
if (researchItem2 == researchItem)
|
||||
{
|
||||
gResearchItemsUninvented.erase(it);
|
||||
return;
|
||||
@@ -429,7 +429,7 @@ void research_remove(ResearchItem* researchItem)
|
||||
for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++)
|
||||
{
|
||||
auto& researchItem2 = *it;
|
||||
if (researchItem2 == *researchItem)
|
||||
if (researchItem2 == researchItem)
|
||||
{
|
||||
gResearchItemsInvented.erase(it);
|
||||
return;
|
||||
|
||||
@@ -176,7 +176,7 @@ void research_populate_list_random();
|
||||
|
||||
void research_finish_item(ResearchItem* researchItem);
|
||||
void research_insert(ResearchItem&& item, bool researched);
|
||||
void research_remove(ResearchItem* researchItem);
|
||||
void ResearchRemove(const ResearchItem& researchItem);
|
||||
|
||||
bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched);
|
||||
void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched);
|
||||
|
||||
Reference in New Issue
Block a user