summaryrefslogtreecommitdiff
path: root/src/battle_setup.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-07-02 08:08:53 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-07-02 08:08:53 -0400
commit6c91368e83e8399a03b8ec97493e6a5d8286db37 (patch)
treed5eccf3944940b851f51a56d292c11a3c0fa4f46 /src/battle_setup.c
parent23872d44fc48a3a879f90443c4d77db1826b8ec8 (diff)
Use -g flag to compile
Diffstat (limited to 'src/battle_setup.c')
-rw-r--r--src/battle_setup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/battle_setup.c b/src/battle_setup.c
index bc569dff7..b6e2faff0 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -1287,8 +1287,9 @@ s32 TrainerIdToRematchTableId(const struct TrainerEyeTrainer *trainers, u16 oppo
for (i = 0; i < NUM_TRAINER_EYE_TRAINERS; i++)
{
- for (j = 0; j < 5 && trainers[i].opponentIDs[j] != 0; j++)
+ for (j = 0; j < 5; j++)
{
+ if (trainers[i].opponentIDs[j] == 0) break; // one-line required to match with -g
if (trainers[i].opponentIDs[j] == opponentId)
return i;
}
@@ -1354,7 +1355,7 @@ bool8 IsFirstTrainerIdReadyForRematch(const struct TrainerEyeTrainer *trainers,
{
s32 trainerEyeIndex = FirstBattleTrainerIdToRematchTableId(trainers, opponentId);
- if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex])
+ if (trainerEyeIndex != -1 && trainerEyeIndex < MAX_REMATCH_ENTRIES && gSaveBlock1.trainerRematches[trainerEyeIndex])
return TRUE;
else
return FALSE;
@@ -1364,7 +1365,7 @@ bool8 GetTrainerEyeRematchFlag(const struct TrainerEyeTrainer *trainers, u16 opp
{
s32 trainerEyeIndex = TrainerIdToRematchTableId(trainers, opponentId);
- if (trainerEyeIndex != -1 && trainerEyeIndex < 100 && gSaveBlock1.trainerRematches[trainerEyeIndex])
+ if (trainerEyeIndex != -1 && trainerEyeIndex < MAX_REMATCH_ENTRIES && gSaveBlock1.trainerRematches[trainerEyeIndex])
return TRUE;
else
return FALSE;