mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix incorrect objects in S6 import
This commit is contained in:
parent
bdab3219cb
commit
8cdece0252
|
@ -1603,9 +1603,18 @@ public:
|
|||
AddRequiredObjects<MAX_SCENARIO_TEXT_OBJECTS>(result, _s6.ScenarioTextObjects);
|
||||
|
||||
ObjectList objectList;
|
||||
for (rct_object_entry entry : result)
|
||||
for (size_t i = 0; i < result.size(); i++)
|
||||
{
|
||||
objectList.Add(ObjectEntryDescriptor(entry));
|
||||
ObjectType objectType;
|
||||
ObjectEntryIndex entryIndex;
|
||||
get_type_entry_index(i, &objectType, &entryIndex);
|
||||
|
||||
auto desc = ObjectEntryDescriptor(result[i]);
|
||||
if (desc.HasValue())
|
||||
{
|
||||
assert(desc.GetType() == objectType);
|
||||
objectList.SetObject(entryIndex, desc);
|
||||
}
|
||||
}
|
||||
|
||||
return objectList;
|
||||
|
|
|
@ -46,7 +46,7 @@ static std::unique_ptr<IContext> localStartGame(const std::string& parkPath)
|
|||
|
||||
auto importer = ParkImporter::CreateS6(context->GetObjectRepository());
|
||||
auto loadResult = importer->LoadSavedGame(parkPath.c_str(), false);
|
||||
context->GetObjectManager().LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size());
|
||||
context->GetObjectManager().LoadObjects(loadResult.RequiredObjects);
|
||||
importer->Import();
|
||||
|
||||
reset_sprite_spatial_index();
|
||||
|
|
|
@ -78,7 +78,7 @@ static bool ImportSave(MemoryStream& stream, std::unique_ptr<IContext>& context,
|
|||
|
||||
auto importer = ParkImporter::CreateS6(context->GetObjectRepository());
|
||||
auto loadResult = importer->LoadFromStream(&stream, false);
|
||||
objManager.LoadObjects(loadResult.RequiredObjects.data(), loadResult.RequiredObjects.size());
|
||||
objManager.LoadObjects(loadResult.RequiredObjects);
|
||||
importer->Import();
|
||||
|
||||
GameInit(retainSpatialIndices);
|
||||
|
|
Loading…
Reference in New Issue