Partner fixes (#4422)
* Partner fixes * Generalise TRAINER_PARTNER(PARTNER_NONE)
This commit is contained in:
parent
9097f438f1
commit
6bde095ae8
2 changed files with 3 additions and 3 deletions
|
@ -168,14 +168,14 @@ static inline const u8 GetTrainerClassFromId(u16 trainerId)
|
|||
static inline const u8 *GetTrainerClassNameFromId(u16 trainerId)
|
||||
{
|
||||
if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
return gTrainerClasses[gBattlePartners[trainerId].trainerClass].name;
|
||||
return gTrainerClasses[gBattlePartners[trainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerClass].name;
|
||||
return gTrainerClasses[GetTrainerClassFromId(trainerId)].name;
|
||||
}
|
||||
|
||||
static inline const u8 *GetTrainerNameFromId(u16 trainerId)
|
||||
{
|
||||
if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
return gBattlePartners[trainerId].trainerName;
|
||||
return gBattlePartners[trainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerName;
|
||||
return gTrainers[SanitizeTrainerId(trainerId)].trainerName;
|
||||
}
|
||||
|
||||
|
|
|
@ -1435,7 +1435,7 @@ u8 GetFrontierOpponentClass(u16 trainerId)
|
|||
}
|
||||
else if (trainerId > TRAINER_PARTNER(PARTNER_NONE))
|
||||
{
|
||||
trainerClass = gBattlePartners[GetTrainerClassFromId(trainerId - TRAINER_PARTNER(PARTNER_NONE))].trainerClass;
|
||||
trainerClass = gBattlePartners[trainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerClass;
|
||||
}
|
||||
else if (trainerId < FRONTIER_TRAINERS_COUNT)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue