From e0271a92e9983284c81c94e666ec8d922618fb58 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 21 Jul 2023 11:40:15 +0200 Subject: [PATCH] Fix trainer messages appearing for frontier trainers --- src/battle_message.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/battle_message.c b/src/battle_message.c index d2ca9dfd7..1585f8c47 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3935,6 +3935,7 @@ u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp) struct TrainerSlide { u16 trainerId; + bool8 isFrontierTrainer; const u8 *msgLastSwitchIn; const u8 *msgLastLowHp; const u8 *msgFirstDown; @@ -3954,6 +3955,7 @@ static const struct TrainerSlide sTrainerSlides[] = Example: { .trainerId = TRAINER_WALLY_VR_2, + .isFrontierTrainer = FALSE, .msgLastSwitchIn = sText_AarghAlmostHadIt, .msgLastLowHp = sText_BoxIsFull, .msgFirstDown = sText_123Poof, @@ -4046,7 +4048,9 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which) for (i = 0; i < ARRAY_COUNT(sTrainerSlides); i++) { - if (trainerId == sTrainerSlides[i].trainerId) + if (trainerId == sTrainerSlides[i].trainerId + && (((gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && sTrainerSlides[i].isFrontierTrainer) + || (!(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && !sTrainerSlides[i].isFrontierTrainer))) { gBattleScripting.battler = battlerId; switch (which)