From 11af1a98cbe5e4bec32795eb031c2eeaef168438 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Mon, 17 Oct 2022 20:49:41 -0400 Subject: [PATCH] Changed do/while to for loop --- src/dungeon_leader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dungeon_leader.c b/src/dungeon_leader.c index 9bd40709c..5bff54220 100644 --- a/src/dungeon_leader.c +++ b/src/dungeon_leader.c @@ -11,8 +11,8 @@ struct DungeonEntity* GetLeaderEntity() struct DungeonEntity *leader = gLeaderPokemon; if (leader == NULL) { - s32 i = 0; - do + s32 i; + for (i = 0; i < MAX_TEAM_MEMBERS; i++) { struct DungeonEntity *currentPokemon = gDungeonGlobalData->teamPokemon[i]; if (EntityExists(currentPokemon) && currentPokemon->entityData->isLeader) @@ -20,7 +20,7 @@ struct DungeonEntity* GetLeaderEntity() gLeaderPokemon = currentPokemon; return currentPokemon; } - } while (++i < MAX_TEAM_MEMBERS); + } return NULL; } return leader;