1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Fix #17610: Some scenery items unavailable in RCT1 scenarios

This commit is contained in:
Gymnasiast
2024-02-08 01:29:27 +01:00
parent 12c00dedeb
commit 6506b1d1fa
2 changed files with 56 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
- Improved: [objects#272, objects#276, objects#277, objects#278, objects#279, objects#280, objects#281] Add missing RCT1 ride and vehicle objects.
- Improved: [objects#275, objects#284, objects#286] Add missing RCT1 walls.
- Change: [#21453] Reintroduce lost RCT1 Jet skis colour presets to the boat hire.
- Fix: [#17610] Some scenery items are unavailable in RCT1 scenarios.
- Fix: [#18963] Research table in parks from Loopy Landscapes is imported incorrectly.
- Fix: [#20907] RCT1/AA scenarios use the 4-across train for the Inverted Roller Coaster.
- Fix: [#21208] Error message will stay open only for a brief moment when the game has been running a while.

View File

@@ -429,12 +429,14 @@ static std::vector<ScenerySelection> GetAllMiscScenery()
{
std::vector<ScenerySelection> miscScenery;
std::vector<ScenerySelection> nonMiscScenery;
std::vector<ObjectEntryIndex> sceneryGroupIds;
for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++)
{
const auto* sgEntry = OpenRCT2::ObjectManager::GetObjectEntry<SceneryGroupEntry>(i);
if (sgEntry != nullptr)
{
nonMiscScenery.insert(nonMiscScenery.end(), sgEntry->SceneryEntries.begin(), sgEntry->SceneryEntries.end());
sceneryGroupIds.emplace_back(i);
}
}
for (uint8_t sceneryType = SCENERY_TYPE_SMALL; sceneryType < SCENERY_TYPE_COUNT; sceneryType++)
@@ -442,6 +444,59 @@ static std::vector<ScenerySelection> GetAllMiscScenery()
const auto maxObjects = GetMaxObjectsForSceneryType(sceneryType);
for (ObjectEntryIndex i = 0; i < maxObjects; i++)
{
ObjectEntryIndex linkedSceneryGroup = OBJECT_ENTRY_INDEX_NULL;
const auto objectType = GetObjectTypeFromSceneryType(sceneryType);
switch (objectType)
{
case ObjectType::SmallScenery:
{
const auto* objectEntry = OpenRCT2::ObjectManager::GetObjectEntry<SmallSceneryEntry>(i);
if (objectEntry != nullptr)
linkedSceneryGroup = objectEntry->scenery_tab_id;
break;
}
case ObjectType::LargeScenery:
{
const auto* objectEntry = OpenRCT2::ObjectManager::GetObjectEntry<LargeSceneryEntry>(i);
if (objectEntry != nullptr)
linkedSceneryGroup = objectEntry->scenery_tab_id;
break;
}
case ObjectType::Walls:
{
const auto* objectEntry = OpenRCT2::ObjectManager::GetObjectEntry<WallSceneryEntry>(i);
if (objectEntry != nullptr)
linkedSceneryGroup = objectEntry->scenery_tab_id;
break;
}
case ObjectType::Banners:
{
const auto* objectEntry = OpenRCT2::ObjectManager::GetObjectEntry<BannerSceneryEntry>(i);
if (objectEntry != nullptr)
linkedSceneryGroup = objectEntry->scenery_tab_id;
break;
}
case ObjectType::PathAdditions:
{
const auto* objectEntry = OpenRCT2::ObjectManager::GetObjectEntry<PathAdditionEntry>(i);
if (objectEntry != nullptr)
linkedSceneryGroup = objectEntry->scenery_tab_id;
break;
}
default:
break;
}
// An object may be link itself against a scenery group, in which case it should not be marked as miscellaneous.
if (linkedSceneryGroup != OBJECT_ENTRY_INDEX_NULL)
{
if (std::find(std::begin(sceneryGroupIds), std::end(sceneryGroupIds), linkedSceneryGroup)
!= std::end(sceneryGroupIds))
{
continue;
}
}
const ScenerySelection sceneryItem = { sceneryType, i };
if (IsSceneryEntryValid(sceneryItem))
{