From 3568c2a882bc089eff960476068381ff87853e5a Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 12 Jun 2021 00:35:15 -0400 Subject: [PATCH] Fixed bug with followers and cross-map scripting events. --- src/event_object_movement.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index b75b0912b0..091bd11b3a 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -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); } }