mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix unloading of objects
This commit is contained in:
parent
d7575732fb
commit
b207f6112d
|
@ -413,6 +413,28 @@ extern "C"
|
|||
}
|
||||
}
|
||||
|
||||
void object_unload_all()
|
||||
{
|
||||
for (int i = 0; i < 721; i++)
|
||||
{
|
||||
Object * object = _loadedObjects[i];
|
||||
if (object != nullptr)
|
||||
{
|
||||
object->Unload();
|
||||
delete object;
|
||||
_loadedObjects[i] = nullptr;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < OBJECT_ENTRY_GROUP_COUNT; i++)
|
||||
{
|
||||
for (int j = 0; j < object_entry_group_counts[i]; j++)
|
||||
{
|
||||
memset(&object_entry_groups[i].entries[j], 0xFF, sizeof(rct_object_entry_extended));
|
||||
object_entry_groups[i].chunks[j] = (uint8*)0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void scenario_translate(scenario_index_entry * scenarioEntry, const rct_object_entry * stexObjectEntry)
|
||||
{
|
||||
rct_string_id localisedStringIds[3];
|
||||
|
|
|
@ -616,7 +616,7 @@ bool object_load_entries(rct_object_entry* entries)
|
|||
*
|
||||
* rct2: 0x006A9CE8
|
||||
*/
|
||||
void object_unload_all()
|
||||
void object_unload_all_old()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
|
Loading…
Reference in New Issue