Fix hit escape switching hardcode (#7403)

This commit is contained in:
Pawkkie 2025-07-25 13:28:24 -04:00 committed by GitHub
parent 38964e4f0a
commit fa129ba906
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -623,6 +623,7 @@ static void OpponentHandleChoosePokemon(u32 battler)
{
s32 chosenMonId;
s32 pokemonInBattle = 1;
enum SwitchType switchType = SWITCH_AFTER_KO;
// Choosing Revival Blessing target
if ((gBattleResources->bufferA[battler][1] & 0xF) == PARTY_ACTION_CHOOSE_FAINTED_MON)
@ -632,7 +633,9 @@ static void OpponentHandleChoosePokemon(u32 battler)
// Switching out
else if (gBattleStruct->AI_monToSwitchIntoId[battler] == PARTY_SIZE)
{
chosenMonId = GetMostSuitableMonToSwitchInto(battler, SWITCH_AFTER_KO);
if (IsSwitchOutEffect(GetMoveEffect(gCurrentMove)) || gAiLogicData->ejectButtonSwitch || gAiLogicData->ejectPackSwitch)
switchType = SWITCH_MID_BATTLE;
chosenMonId = GetMostSuitableMonToSwitchInto(battler, switchType);
if (chosenMonId == PARTY_SIZE)
{
s32 battler1, battler2, firstId, lastId;