fix: non-following pokemon using slide-in battle animation

This commit is contained in:
Ariel A 2025-01-21 23:27:57 -05:00
parent c492bb3fec
commit ce9f3b95f3

View File

@ -2198,17 +2198,24 @@ static void PlayerHandleSwitchInAnim(void)
gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnimShowHealthbox;
}
// In normal singles, if follower pokemon is out, have it slide in instead of being thrown
// In normal singles, if follower pokemon exists,
// and the pokemon following is being sent out,
// have it slide in instead of being thrown
static bool8 ShouldDoSlideInAnim(void) {
struct ObjectEvent *followerObj = GetFollowerObject();
if (!followerObj || followerObj->invisible)
return FALSE;
if (gBattleTypeFlags & (
BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FIRST_BATTLE |
BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TWO_OPPONENTS |
BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_RECORDED | BATTLE_TYPE_TRAINER_HILL)
)
return FALSE;
if (GetFirstLiveMon() != &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]])
return FALSE;
return TRUE;
}