mirror of https://github.com/OpenRCT2/OpenRCT2.git
Make research_remove take const ref
This commit is contained in:
parent
eba2041aaa
commit
5cf4a53b66
|
@ -155,7 +155,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex)
|
||||||
w->Invalidate();
|
w->Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
research_remove(&_editorInventionsListDraggedItem);
|
research_remove(_editorInventionsListDraggedItem);
|
||||||
|
|
||||||
auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented;
|
auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented;
|
||||||
if (beforeItem != nullptr)
|
if (beforeItem != nullptr)
|
||||||
|
|
|
@ -318,7 +318,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip
|
||||||
tmp.type = Research::EntryType::Ride;
|
tmp.type = Research::EntryType::Ride;
|
||||||
tmp.entryIndex = entryIndex;
|
tmp.entryIndex = entryIndex;
|
||||||
tmp.baseRideType = rideType;
|
tmp.baseRideType = rideType;
|
||||||
research_remove(&tmp);
|
research_remove(tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ static void remove_selected_objects_from_research(ObjectEntryDescriptor& descrip
|
||||||
ResearchItem tmp = {};
|
ResearchItem tmp = {};
|
||||||
tmp.type = Research::EntryType::Scenery;
|
tmp.type = Research::EntryType::Scenery;
|
||||||
tmp.entryIndex = entryIndex;
|
tmp.entryIndex = entryIndex;
|
||||||
research_remove(&tmp);
|
research_remove(tmp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -415,12 +415,12 @@ static void research_insert_researched(ResearchItem&& item)
|
||||||
*
|
*
|
||||||
* rct2: 0x006857CF
|
* rct2: 0x006857CF
|
||||||
*/
|
*/
|
||||||
void research_remove(ResearchItem* researchItem)
|
void research_remove(const ResearchItem& researchItem)
|
||||||
{
|
{
|
||||||
for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++)
|
for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++)
|
||||||
{
|
{
|
||||||
auto& researchItem2 = *it;
|
auto& researchItem2 = *it;
|
||||||
if (researchItem2 == *researchItem)
|
if (researchItem2 == researchItem)
|
||||||
{
|
{
|
||||||
gResearchItemsUninvented.erase(it);
|
gResearchItemsUninvented.erase(it);
|
||||||
return;
|
return;
|
||||||
|
@ -429,7 +429,7 @@ void research_remove(ResearchItem* researchItem)
|
||||||
for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++)
|
for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++)
|
||||||
{
|
{
|
||||||
auto& researchItem2 = *it;
|
auto& researchItem2 = *it;
|
||||||
if (researchItem2 == *researchItem)
|
if (researchItem2 == researchItem)
|
||||||
{
|
{
|
||||||
gResearchItemsInvented.erase(it);
|
gResearchItemsInvented.erase(it);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -176,7 +176,7 @@ void research_populate_list_random();
|
||||||
|
|
||||||
void research_finish_item(ResearchItem* researchItem);
|
void research_finish_item(ResearchItem* researchItem);
|
||||||
void research_insert(ResearchItem&& item, bool researched);
|
void research_insert(ResearchItem&& item, bool researched);
|
||||||
void research_remove(ResearchItem* researchItem);
|
void research_remove(const ResearchItem& researchItem);
|
||||||
|
|
||||||
bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched);
|
bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched);
|
||||||
void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched);
|
void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched);
|
||||||
|
|
Loading…
Reference in New Issue