mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-30 01:09:34 +01:00
Fix trainer slide messages appearing for frontier trainers (#3162)
This commit is contained in:
commit
f5d5e544d1
@ -3935,6 +3935,7 @@ u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp)
|
|||||||
struct TrainerSlide
|
struct TrainerSlide
|
||||||
{
|
{
|
||||||
u16 trainerId;
|
u16 trainerId;
|
||||||
|
bool8 isFrontierTrainer;
|
||||||
const u8 *msgLastSwitchIn;
|
const u8 *msgLastSwitchIn;
|
||||||
const u8 *msgLastLowHp;
|
const u8 *msgLastLowHp;
|
||||||
const u8 *msgFirstDown;
|
const u8 *msgFirstDown;
|
||||||
@ -3954,6 +3955,7 @@ static const struct TrainerSlide sTrainerSlides[] =
|
|||||||
Example:
|
Example:
|
||||||
{
|
{
|
||||||
.trainerId = TRAINER_WALLY_VR_2,
|
.trainerId = TRAINER_WALLY_VR_2,
|
||||||
|
.isFrontierTrainer = FALSE,
|
||||||
.msgLastSwitchIn = sText_AarghAlmostHadIt,
|
.msgLastSwitchIn = sText_AarghAlmostHadIt,
|
||||||
.msgLastLowHp = sText_BoxIsFull,
|
.msgLastLowHp = sText_BoxIsFull,
|
||||||
.msgFirstDown = sText_123Poof,
|
.msgFirstDown = sText_123Poof,
|
||||||
@ -4046,7 +4048,9 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which)
|
|||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrainerSlides); i++)
|
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;
|
gBattleScripting.battler = battlerId;
|
||||||
switch (which)
|
switch (which)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user