1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Add the ability to temporarily load objects without registering them (#24521)

This commit is contained in:
Matt
2025-05-28 01:13:42 +03:00
committed by GitHub
parent a7b12594c8
commit d2e3430df2
5 changed files with 34 additions and 38 deletions

View File

@@ -163,6 +163,21 @@ public:
return objectList;
}
std::unique_ptr<Object> LoadTempObject(std::string_view id) override
{
const ObjectRepositoryItem* ori = _objectRepository.FindObject(id);
if (ori == nullptr)
{
LOG_ERROR("Object '%s' not found in repository.", std::string{ id }.c_str());
return nullptr;
}
auto object = _objectRepository.LoadObject(ori);
object->Load();
return object;
}
Object* LoadObject(std::string_view identifier) override
{
const ObjectRepositoryItem* ori = _objectRepository.FindObject(identifier);