mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 10:51:58 -05:00
Fix scenery group set research status import
There were a lot of small issues that compounded into making this bug occur
This commit is contained in:
parent
22b9671435
commit
f8091a462e
4 changed files with 14 additions and 6 deletions
|
@ -355,6 +355,7 @@ static void remove_selected_objects_from_research(const ObjectEntryDescriptor& d
|
|||
ResearchItem tmp = {};
|
||||
tmp.type = Research::EntryType::Scenery;
|
||||
tmp.entryIndex = entryIndex;
|
||||
tmp.baseRideType = 0;
|
||||
ResearchRemove(tmp);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -529,8 +529,7 @@ bool research_insert_scenery_group_entry(ObjectEntryIndex entryIndex, bool resea
|
|||
{
|
||||
if (entryIndex != OBJECT_ENTRY_INDEX_NULL)
|
||||
{
|
||||
auto tmpItem = ResearchItem(
|
||||
Research::EntryType::Scenery, entryIndex, RIDE_TYPE_NULL, ResearchCategory::SceneryGroup, 0);
|
||||
auto tmpItem = ResearchItem(Research::EntryType::Scenery, entryIndex, 0, ResearchCategory::SceneryGroup, 0);
|
||||
research_insert(std::move(tmpItem), researched);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -117,13 +117,20 @@ struct ResearchItem
|
|||
}
|
||||
else
|
||||
{
|
||||
entryIndex = RCTEntryIndexToOpenRCT2EntryIndex(oldResearchItem.entryIndex);
|
||||
auto* rideEntry = get_ride_entry(entryIndex);
|
||||
baseRideType = rideEntry != nullptr ? RCT2RideTypeToOpenRCT2RideType(oldResearchItem.baseRideType, rideEntry)
|
||||
: oldResearchItem.baseRideType;
|
||||
type = Research::EntryType{ oldResearchItem.type };
|
||||
entryIndex = RCTEntryIndexToOpenRCT2EntryIndex(oldResearchItem.entryIndex);
|
||||
flags = oldResearchItem.flags;
|
||||
category = static_cast<ResearchCategory>(oldResearchItem.category);
|
||||
if (type == Research::EntryType::Ride)
|
||||
{
|
||||
auto* rideEntry = get_ride_entry(entryIndex);
|
||||
baseRideType = rideEntry != nullptr ? RCT2RideTypeToOpenRCT2RideType(oldResearchItem.baseRideType, rideEntry)
|
||||
: oldResearchItem.baseRideType;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseRideType = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2289,6 +2289,7 @@ namespace RCT1
|
|||
dst->entryIndex = entryIndex;
|
||||
dst->type = Research::EntryType::Scenery;
|
||||
dst->category = ResearchCategory::SceneryGroup;
|
||||
dst->baseRideType = 0;
|
||||
dst->flags = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue