mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 13:03:11 +01:00
Add new .park save format
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com> Co-authored-by: duncanspumpkin <duncanspumpkin@users.noreply.github.com> Co-authored-by: ZehMatt <Zehmatt@users.noreply.github.com> Co-authored-by: Broxzier <Broxzier@users.noreply.github.com>
This commit is contained in:
@@ -688,25 +688,6 @@ static ObjectEntryIndex TrackDesignGetDefaultRailingIndex()
|
||||
return OBJECT_ENTRY_INDEX_NULL;
|
||||
}
|
||||
|
||||
static ObjectEntryIndex TrackDesignGetDefaultPathIndex(bool isQueue)
|
||||
{
|
||||
for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++)
|
||||
{
|
||||
auto legacyPathEntry = GetLegacyFootpathEntry(i);
|
||||
if (legacyPathEntry != nullptr)
|
||||
{
|
||||
const auto& surfaceDescriptor = isQueue ? legacyPathEntry->GetQueueSurfaceDescriptor()
|
||||
: legacyPathEntry->GetPathSurfaceDescriptor();
|
||||
if (surfaceDescriptor.IsEditorOnly())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return OBJECT_ENTRY_INDEX_NULL;
|
||||
}
|
||||
|
||||
static std::optional<TrackSceneryEntry> TrackDesignPlaceSceneryElementGetEntry(const TrackDesignSceneryElement& scenery)
|
||||
{
|
||||
TrackSceneryEntry result;
|
||||
@@ -742,14 +723,7 @@ static std::optional<TrackSceneryEntry> TrackDesignPlaceSceneryElementGetEntry(c
|
||||
if (result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL)
|
||||
result.SecondaryIndex = TrackDesignGetDefaultRailingIndex();
|
||||
|
||||
// NOTE: This block can be deleted in the NSF branch.
|
||||
if (result.Index == OBJECT_ENTRY_INDEX_NULL)
|
||||
{
|
||||
result.Type = ObjectType::Paths;
|
||||
result.Index = TrackDesignGetDefaultPathIndex(scenery.IsQueue());
|
||||
}
|
||||
|
||||
if (result.Index == OBJECT_ENTRY_INDEX_NULL)
|
||||
if (result.Index == OBJECT_ENTRY_INDEX_NULL || result.SecondaryIndex == OBJECT_ENTRY_INDEX_NULL)
|
||||
{
|
||||
_trackDesignPlaceStateSceneryUnavailable = true;
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user