1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Fix #12535, #12536: RCT1 import can crash when too many misc entities (#12580)

Eventually this can be fixed properly in the new save format
This commit is contained in:
Duncan
2020-08-04 00:07:13 +01:00
committed by GitHub
parent 4fcdcc3729
commit 87953ace9b

View File

@@ -1659,6 +1659,11 @@ private:
{
rct1_unk_sprite* src = &sprite.unknown;
SpriteGeneric* dst = reinterpret_cast<SpriteGeneric*>(create_sprite(SPRITE_IDENTIFIER_MISC));
if (dst == nullptr)
{
log_warning("SV4 has too many misc entities. No more misc entities will be imported!");
break;
}
dst->sprite_identifier = src->sprite_identifier;
dst->type = src->type;
dst->flags = src->flags;