diff --git a/src/world/map_animation.c b/src/world/map_animation.c index 0ce1832451..18cb07daf0 100644 --- a/src/world/map_animation.c +++ b/src/world/map_animation.c @@ -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;