mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 15:24:30 +01:00
Adjust the import/export code to have the game state passed
This commit is contained in:
@@ -2797,7 +2797,10 @@ bool NetworkBase::LoadMap(IStream* stream)
|
||||
auto importer = ParkImporter::CreateParkFile(context.GetObjectRepository());
|
||||
auto loadResult = importer->LoadFromStream(stream, false);
|
||||
objManager.LoadObjects(loadResult.RequiredObjects);
|
||||
importer->Import();
|
||||
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = GetGameState();
|
||||
importer->Import(gameState);
|
||||
|
||||
EntityTweener::Get().Reset();
|
||||
MapAnimationAutoCreate();
|
||||
@@ -2820,7 +2823,9 @@ bool NetworkBase::SaveMap(IStream* stream, const std::vector<const ObjectReposit
|
||||
{
|
||||
auto exporter = std::make_unique<ParkFileExporter>();
|
||||
exporter->ExportObjectsList = objects;
|
||||
exporter->Export(*stream);
|
||||
|
||||
auto& gameState = GetGameState();
|
||||
exporter->Export(gameState, *stream);
|
||||
result = true;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
||||
Reference in New Issue
Block a user