mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Do not read from repository when loading objects
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user