mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix misc scenery not marked as invented
This commit is contained in:
parent
d63b57c359
commit
915e6447f9
|
@ -794,6 +794,7 @@ static void ResearchRebuildInventedTables()
|
|||
|
||||
research_mark_item_as_researched(item);
|
||||
}
|
||||
MarkAllUnrestrictedSceneryAsInvented();
|
||||
}
|
||||
|
||||
static void ResearchAddAllMissingItems(bool isResearched)
|
||||
|
|
|
@ -370,8 +370,9 @@ std::vector<ScenerySelection>& GetRestrictedScenery()
|
|||
return _restrictedScenery;
|
||||
}
|
||||
|
||||
void RestrictAllMiscScenery()
|
||||
static std::vector<ScenerySelection> GetAllMiscScenery()
|
||||
{
|
||||
std::vector<ScenerySelection> miscScenery;
|
||||
std::vector<ScenerySelection> nonMiscScenery;
|
||||
for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++)
|
||||
{
|
||||
|
@ -395,11 +396,30 @@ void RestrictAllMiscScenery()
|
|||
{
|
||||
if (std::find(std::begin(nonMiscScenery), std::end(nonMiscScenery), sceneryItem) == std::end(nonMiscScenery))
|
||||
{
|
||||
_restrictedScenery.push_back(sceneryItem);
|
||||
miscScenery.push_back(sceneryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return miscScenery;
|
||||
}
|
||||
|
||||
void RestrictAllMiscScenery()
|
||||
{
|
||||
auto miscScenery = GetAllMiscScenery();
|
||||
_restrictedScenery.insert(_restrictedScenery.begin(), miscScenery.begin(), miscScenery.end());
|
||||
}
|
||||
|
||||
void MarkAllUnrestrictedSceneryAsInvented()
|
||||
{
|
||||
auto miscScenery = GetAllMiscScenery();
|
||||
for (const auto& sceneryItem : miscScenery)
|
||||
{
|
||||
if (std::find(_restrictedScenery.begin(), _restrictedScenery.end(), sceneryItem) == _restrictedScenery.end())
|
||||
{
|
||||
scenery_set_invented(sceneryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ObjectType GetObjectTypeFromSceneryType(uint8_t type)
|
||||
|
|
|
@ -300,6 +300,7 @@ bool IsSceneryAvailableToBuild(const ScenerySelection& item);
|
|||
bool IsSceneryItemRestricted(const ScenerySelection& item);
|
||||
void ClearRestrictedScenery();
|
||||
void RestrictAllMiscScenery();
|
||||
void MarkAllUnrestrictedSceneryAsInvented();
|
||||
std::vector<ScenerySelection>& GetRestrictedScenery();
|
||||
|
||||
ObjectType GetObjectTypeFromSceneryType(uint8_t type);
|
||||
|
|
Loading…
Reference in New Issue