Fixed GetFollowerObject being able to sometimes return removed/inactive objects.

This commit is contained in:
Ariel A 2022-04-30 14:54:47 -04:00
parent 2bc5da3f2f
commit 5e1c6e0f25

View file

@ -1680,7 +1680,7 @@ struct Pokemon * GetFirstLiveMon(void) { // Return address of first conscious pa
struct ObjectEvent * GetFollowerObject(void) { // Return follower ObjectEvent or NULL
u8 i;
for (i=0; i < OBJECT_EVENTS_COUNT; i++) {
if (gObjectEvents[i].localId == OBJ_EVENT_ID_FOLLOWER)
if (gObjectEvents[i].localId == OBJ_EVENT_ID_FOLLOWER && gObjectEvents[i].active)
return &gObjectEvents[i];
}
return NULL;