1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Add check to prevent exceeding the maximum number of animations. Probable cause of #2381

This commit is contained in:
duncanspumpkin
2015-11-27 18:01:45 +00:00
parent a8d837ea76
commit 119ca58cc7

View File

@@ -49,6 +49,10 @@ void map_animation_create(int type, int x, int y, int z)
{
rct_map_animation *aobj = &gAnimatedObjects[0];
int numAnimatedObjects = RCT2_GLOBAL(0x0138B580, uint16);
if (numAnimatedObjects >= 2000) {
log_error("Exceeded the maximum number of animations");
return;
}
for (int i = 0; i < numAnimatedObjects; i++, aobj++) {
if (aobj->x != x)
continue;