Do not read from repository when loading objects

This commit is contained in:
Gymnasiast committed 2025-09-23 14:09:09 +02:00
1 parent 3e11a8efdf
commit f768d2873e
4 files changed
+17 -22

No files matched your search

+4 -11
View File
@@ -44,18 +44,11 @@ namespace OpenRCT2
// Add banners to 'Signs and items for footpaths' group, rather than lumping them in the Miscellaneous tab.
// Since this is already done the other way round for original items, avoid adding those to prevent duplicates.
auto& objectRepository = context->GetObjectRepository();
auto item = objectRepository.FindObject(GetDescriptor());
if (item != nullptr)
auto firstSourceGame = GetFirstSourceGame();
if (firstSourceGame == ObjectSourceGame::Custom)
{
auto sourceGame = item->GetFirstSourceGame();
if (sourceGame == ObjectSourceGame::WackyWorlds || sourceGame == ObjectSourceGame::TimeTwister
|| sourceGame == ObjectSourceGame::Custom)
{
auto scgPathX = Object::GetScgPathXHeader();
SetPrimarySceneryGroup(scgPathX);
}
auto scgPathX = Object::GetScgPathXHeader();
SetPrimarySceneryGroup(scgPathX);
}
}
+8
View File
@@ -192,6 +192,14 @@ namespace OpenRCT2
return _sourceGames;
}
ObjectSourceGame Object::GetFirstSourceGame() const
{
if (_sourceGames.size() == 0)
return ObjectSourceGame::Custom;
return _sourceGames[0];
}
void Object::SetSourceGames(const std::vector<ObjectSourceGame>& sourceGames)
{
_sourceGames = sourceGames;
+1
View File
@@ -304,6 +304,7 @@ namespace OpenRCT2
{
}
std::vector<ObjectSourceGame> GetSourceGames();
ObjectSourceGame GetFirstSourceGame() const;
void SetSourceGames(const std::vector<ObjectSourceGame>& sourceGames);
const std::vector<std::string>& GetAuthors() const;
+4 -11
View File
@@ -47,18 +47,11 @@ namespace OpenRCT2
// Add path additions to 'Signs and items for footpaths' group, rather than lumping them in the Miscellaneous tab.
// Since this is already done the other way round for original items, avoid adding those to prevent duplicates.
auto& objectRepository = context->GetObjectRepository();
auto item = objectRepository.FindObject(GetDescriptor());
if (item != nullptr)
auto firstSourceGame = GetFirstSourceGame();
if (firstSourceGame == ObjectSourceGame::Custom)
{
auto sourceGame = item->GetFirstSourceGame();
if (sourceGame == ObjectSourceGame::WackyWorlds || sourceGame == ObjectSourceGame::TimeTwister
|| sourceGame == ObjectSourceGame::Custom)
{
auto scgPathX = Object::GetScgPathXHeader();
SetPrimarySceneryGroup(scgPathX);
}
auto scgPathX = Object::GetScgPathXHeader();
SetPrimarySceneryGroup(scgPathX);
}
}