1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

Read and write version field of .park

This commit is contained in:
spacek531
2022-11-23 14:20:44 -08:00
committed by GitHub
parent 0ea5f343af
commit a617d393ed
5 changed files with 15 additions and 2 deletions

View File

@@ -521,6 +521,7 @@ namespace ObjectFactory
if (id == OpenRCT2::Audio::AudioObjectIdentifiers::Rct2cBase)
id = OpenRCT2::Audio::AudioObjectIdentifiers::Rct2Base;
auto version = Json::GetString(jRoot["version"]);
ObjectEntryDescriptor descriptor;
auto originalId = Json::GetString(jRoot["originalId"]);
if (originalId.length() == 8 + 1 + 8 + 1 + 8)
@@ -539,8 +540,9 @@ namespace ObjectFactory
{
descriptor = ObjectEntryDescriptor(objectType, id);
}
descriptor.Version = version;
result = CreateObject(objectType);
result->SetVersion(version);
result->SetIdentifier(id);
result->SetDescriptor(descriptor);
result->MarkAsJsonObject();