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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user