mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
fix scenery group population
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "Object.h"
|
||||
#include "ObjectManager.h"
|
||||
#include "ObjectRepository.h"
|
||||
#include "SceneryGroupObject.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -94,6 +95,7 @@ public:
|
||||
{
|
||||
_loadedObjects[slot] = loadedObject;
|
||||
UpdateLegacyLoadedObjectList();
|
||||
UpdateSceneryGroupIndexes();
|
||||
reset_type_to_ride_entry_index_map();
|
||||
}
|
||||
}
|
||||
@@ -130,6 +132,7 @@ public:
|
||||
{
|
||||
SetNewLoadedObjectList(loadedObjects);
|
||||
UpdateLegacyLoadedObjectList();
|
||||
UpdateSceneryGroupIndexes();
|
||||
reset_type_to_ride_entry_index_map();
|
||||
// Console::WriteLine("%u / %u new objects loaded", numNewLoadedObjects, numRequiredObjects);
|
||||
return true;
|
||||
@@ -162,6 +165,7 @@ public:
|
||||
if (numObjectsUnloaded > 0)
|
||||
{
|
||||
UpdateLegacyLoadedObjectList();
|
||||
UpdateSceneryGroupIndexes();
|
||||
reset_type_to_ride_entry_index_map();
|
||||
}
|
||||
}
|
||||
@@ -177,6 +181,7 @@ public:
|
||||
}
|
||||
}
|
||||
UpdateLegacyLoadedObjectList();
|
||||
UpdateSceneryGroupIndexes();
|
||||
reset_type_to_ride_entry_index_map();
|
||||
}
|
||||
|
||||
@@ -329,6 +334,25 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateSceneryGroupIndexes()
|
||||
{
|
||||
if (_loadedObjects != nullptr)
|
||||
{
|
||||
for (size_t i = 0; i < OBJECT_ENTRY_COUNT; i++)
|
||||
{
|
||||
Object * loadedObject = _loadedObjects[i];
|
||||
if (loadedObject != nullptr)
|
||||
{
|
||||
if (loadedObject->GetObjectType() == OBJECT_TYPE_SCENERY_SETS)
|
||||
{
|
||||
auto sgObject = static_cast<SceneryGroupObject *>(loadedObject);
|
||||
sgObject->UpdateEntryIndexes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GetRequiredObjects(const rct_object_entry * entries,
|
||||
const ObjectRepositoryItem * * requiredObjects,
|
||||
size_t * outNumRequiredObjects)
|
||||
|
||||
Reference in New Issue
Block a user