From e7bc42fcafd269c3f46c70568fa0655ac965b1eb Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 3 Aug 2023 21:17:39 +0200 Subject: [PATCH] use IsValidForBattle --- src/battle_controller_opponent.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 4b8820f9b9..a786dafa69 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1707,8 +1707,7 @@ static void OpponentHandleChoosePokemon(void) for (chosenMonId = (lastId-1); chosenMonId >= firstId; chosenMonId--) { - if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 - && GetMonData(&gEnemyParty[chosenMonId], MON_DATA_SPECIES) != SPECIES_NONE + if (IsValidForBattle(&gEnemyParty[chosenMonId]) && chosenMonId != gBattlerPartyIndexes[battler1] && chosenMonId != gBattlerPartyIndexes[battler2] && (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON)