Fixed objects not getting unloaded properly when event flags are set (#6715)

This commit is contained in:
hedara90 2025-04-28 21:06:31 +02:00 committed by GitHub
commit 4b4a679b96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2783,8 +2783,7 @@ void RemoveObjectEventsOutsideView(void)
// 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
&& (PlayerHasFollowerNPC() && i != GetFollowerNPCObjectId())
)
&& objectEvent->localId != OBJ_EVENT_ID_NPC_FOLLOWER)
RemoveObjectEventIfOutsideView(objectEvent);
}
}