Skip to content

Commit

Permalink
Merge pull request #2324 from ghoulslash/be/aiswitch
Browse files Browse the repository at this point in the history
fix ai switch semi invulnerable
  • Loading branch information
ghoulslash authored Sep 16, 2022
2 parents 7825153 + 95a3ead commit ed81ec4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void)

//Semi-Invulnerable
if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE)
{
if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch
switchMon = TRUE;
if (!AI_OpponentCanFaintAiWithMod(0)
Expand All @@ -380,6 +381,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void)
&& !WillAIStrikeFirst()
&& !AI_OpponentCanFaintAiWithMod(0))
switchMon = FALSE;
}
}

if (switchMon)
Expand Down

0 comments on commit ed81ec4

Please sign in to comment.