Fixed bug with followers and cross-map scripting events.

This commit is contained in:
Ariel Antonitis 2021-06-12 00:35:15 -04:00
parent e4b9bb75e2
commit 3568c2a882

View file

@ -2064,7 +2064,9 @@ void RemoveObjectEventsOutsideView(void)
{
struct ObjectEvent *objectEvent = &gObjectEvents[i];
if (objectEvent->active && !objectEvent->isPlayer)
// Followers should not go OOB, or their sprites may be freed early during a cross-map scripting event,
// such as Wally's Ralts catch sequence
if (objectEvent->active && !objectEvent->isPlayer && objectEvent->localId != OBJ_EVENT_ID_FOLLOWER)
RemoveObjectEventIfOutsideView(objectEvent);
}
}