mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Defer temp object Load/Unload to calling side
This commit is contained in:
@@ -243,10 +243,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
auto& objManager = GetContext()->GetObjectManager();
|
||||
|
||||
if (auto obj = objManager.LoadTempObject(source.textObjectId); obj != nullptr)
|
||||
{
|
||||
auto& scenarioMetaObj = reinterpret_cast<ScenarioMetaObject&>(*obj);
|
||||
scenarioMetaObj.Load();
|
||||
|
||||
ParkPreview preview{};
|
||||
preview.images.push_back(scenarioMetaObj.GetMiniMapImage());
|
||||
|
||||
@@ -173,8 +173,6 @@ public:
|
||||
}
|
||||
|
||||
auto object = _objectRepository.LoadObject(ori);
|
||||
object->Load();
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
@@ -276,8 +276,6 @@ namespace OpenRCT2::RCT1
|
||||
auto& textObject = reinterpret_cast<ScenarioMetaObject&>(*obj);
|
||||
name = textObject.GetScenarioName();
|
||||
details = textObject.GetScenarioDetails();
|
||||
|
||||
obj->Unload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,8 +301,6 @@ namespace OpenRCT2::RCT2
|
||||
auto& textObject = reinterpret_cast<ScenarioMetaObject&>(*obj);
|
||||
dst->Name = textObject.GetScenarioName();
|
||||
dst->Details = textObject.GetScenarioDetails();
|
||||
|
||||
obj->Unload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user