mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #8411: Save game failed!
Do not try to pack our new object types (stations and surfaces) into saved games.
This commit is contained in:
parent
cefa4c3935
commit
85b443fc15
|
@ -202,7 +202,7 @@ public:
|
|||
for (size_t i = 0; i < numObjects; i++)
|
||||
{
|
||||
const ObjectRepositoryItem* item = &_objectRepository.GetObjects()[i];
|
||||
if (item->LoadedObject != nullptr && item->LoadedObject->GetLegacyData() != nullptr && IsObjectCustom(item))
|
||||
if (item->LoadedObject != nullptr && IsObjectCustom(item) && item->LoadedObject->GetLegacyData() != nullptr)
|
||||
{
|
||||
objects.push_back(item);
|
||||
}
|
||||
|
|
|
@ -627,6 +627,14 @@ bool IsObjectCustom(const ObjectRepositoryItem* object)
|
|||
{
|
||||
Guard::ArgumentNotNull(object);
|
||||
|
||||
// Do not count our new object types as custom yet, otherwise the game
|
||||
// will try to pack them into saved games.
|
||||
auto type = object_entry_get_type(&object->ObjectEntry);
|
||||
if (type > OBJECT_TYPE_SCENARIO_TEXT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate the object is not one from base game or expansion pack
|
||||
return !(object->ObjectEntry.flags & 0xF0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue