use IsValidForBattle

This commit is contained in:
DizzyEggg 2023-08-03 21:17:39 +02:00
parent c11839c648
commit e7bc42fcaf

View file

@ -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)