forked from rosebudai/OpenRCT2-Web
Add check to prevent exceeding the maximum number of animations. Probable cause of #2381
This commit is contained in:
1 parent
a8d837ea76
commit
119ca58cc7
1 file changed
+4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user