Skip to content

Commit

Permalink
Fix Baton Pass for when Ace mon is the last alive (#3067)
Browse files Browse the repository at this point in the history
* Updated preproc config for Diamond Storm

* Fix baton pass bug with IsAceMon

remove not needed check

---------

Co-authored-by: LOuroboros <[email protected]>
  • Loading branch information
AlexOn1ine and LOuroboros authored Jun 21, 2023
1 parent 97bc8e4 commit 43821d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,8 @@ u8 GetMostSuitableMonToSwitchInto(void)
if (bestMonId != PARTY_SIZE)
return bestMonId;

// If ace mon is the last available Pokemon and U-Turn/Volt Switch was used - switch to the mon.
if (aceMonId != PARTY_SIZE
&& (gBattleMoves[gLastUsedMove].effect == EFFECT_HIT_ESCAPE || gBattleMoves[gLastUsedMove].effect == EFFECT_PARTING_SHOT))
// If ace mon is the last available Pokemon and switch move was used - switch to the mon.
if (aceMonId != PARTY_SIZE)
return aceMonId;

return PARTY_SIZE;
Expand Down
2 changes: 1 addition & 1 deletion src/data/battle_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -9895,7 +9895,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =

[MOVE_DIAMOND_STORM] =
{
#if B_UPDATED_MOVE_DATA >= GEN_4
#if B_UPDATED_MOVE_DATA >= GEN_7
.effect = EFFECT_DEFENSE_UP2_HIT,
#else
.effect = EFFECT_DEFENSE_UP_HIT,
Expand Down

0 comments on commit 43821d6

Please sign in to comment.