diff --git a/include/data.h b/include/data.h index feae0d87b2..652f396c03 100644 --- a/include/data.h +++ b/include/data.h @@ -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; } diff --git a/src/battle_tower.c b/src/battle_tower.c index 477a08742b..cd94e7919b 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -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) {