summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
authorDizzyEggg <jajkodizzy@wp.pl>2018-06-30 18:55:34 +0200
committerDizzyEggg <jajkodizzy@wp.pl>2018-06-30 18:55:34 +0200
commit2d0be91217e0ea16f298bb823e954a4d6f6ff63b (patch)
treeef66209a3aa7312cde9d69a2d55f0eaecc2876fd /src/pokemon.c
parentbfc64c9689d4518c64ba15cd7d52b9a6149fd218 (diff)
Move all trainer defines to trainers.h and identify frontier brain trainer id
Diffstat (limited to 'src/pokemon.c')
-rw-r--r--src/pokemon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index 800b7c0cd..a4d62feca 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -2488,7 +2488,7 @@ static bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
return FALSE;
if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
return FALSE;
- if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
+ if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
return FALSE;
if (FlagGet(badgeFlag))
return TRUE;
@@ -5678,7 +5678,7 @@ const u8 *GetTrainerPartnerName(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
{
- if (gPartnerTrainerId == STEVEN_PARTNER_ID)
+ if (gPartnerTrainerId == TRAINER_STEVEN_PARTNER)
{
return gTrainers[TRAINER_STEVEN].trainerName;
}
@@ -5891,15 +5891,15 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality)
const u8 *GetTrainerClassNameFromId(u16 trainerId)
{
- if (trainerId > NO_OF_TRAINERS)
- trainerId = 0;
+ if (trainerId >= TRAINERS_COUNT)
+ trainerId = TRAINER_NONE;
return gTrainerClassNames[gTrainers[trainerId].trainerClass];
}
const u8 *GetTrainerNameFromId(u16 trainerId)
{
- if (trainerId > NO_OF_TRAINERS)
- trainerId = 0;
+ if (trainerId >= TRAINERS_COUNT)
+ trainerId = TRAINER_NONE;
return gTrainers[trainerId].trainerName;
}