summaryrefslogtreecommitdiff
path: root/src/frontier_util.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-10-24 15:49:45 -0400
committerGriffinR <griffin.g.richards@gmail.com>2021-10-24 16:13:07 -0400
commit7a89ad98c38cee231a2659135ef487bb5fc5ad9d (patch)
treed6b01b6acabbf98ab8b24caa1d9ce08b283c4270 /src/frontier_util.c
parent7f3c52993573b3cc1c8d1013c68d9b57c3146bd7 (diff)
Document record mixing hall records
Diffstat (limited to 'src/frontier_util.c')
-rw-r--r--src/frontier_util.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/frontier_util.c b/src/frontier_util.c
index bb758de4b..ec3eba43a 100644
--- a/src/frontier_util.c
+++ b/src/frontier_util.c
@@ -2303,20 +2303,20 @@ static void Fill1PRecords(struct RankingHall1P *dst, s32 hallFacilityId, s32 lvl
static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode)
{
s32 i, j;
- struct RankingHall2P record2P[4];
+ struct RankingHall2P record2P[HALL_RECORDS_COUNT + 1];
struct PlayerHallRecords *playerHallRecords = calloc(1, sizeof(struct PlayerHallRecords));
GetPlayerHallRecords(playerHallRecords);
- for (i = 0; i < 3; i++)
+ for (i = 0; i < HALL_RECORDS_COUNT; i++)
record2P[i] = gSaveBlock2Ptr->hallRecords2P[lvlMode][i];
- record2P[3] = playerHallRecords->twoPlayers[lvlMode];
+ record2P[HALL_RECORDS_COUNT] = playerHallRecords->twoPlayers[lvlMode];
- for (i = 0; i < 3; i++)
+ for (i = 0; i < HALL_RECORDS_COUNT; i++)
{
s32 highestWinStreak = 0;
s32 highestId = 0;
- for (j = 0; j < 3; j++)
+ for (j = 0; j < HALL_RECORDS_COUNT; j++)
{
if (record2P[j].winStreak > highestWinStreak)
{
@@ -2324,8 +2324,8 @@ static void Fill2PRecords(struct RankingHall2P *dst, s32 lvlMode)
highestWinStreak = record2P[j].winStreak;
}
}
- if (record2P[3].winStreak >= highestWinStreak)
- highestId = 3;
+ if (record2P[HALL_RECORDS_COUNT].winStreak >= highestWinStreak)
+ highestId = HALL_RECORDS_COUNT;
dst[i] = record2P[highestId];
record2P[highestId].winStreak = 0;
@@ -2338,8 +2338,8 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode)
{
s32 i;
s32 x;
- struct RankingHall1P records1P[3];
- struct RankingHall2P records2P[3];
+ struct RankingHall1P records1P[HALL_RECORDS_COUNT];
+ struct RankingHall2P records2P[HALL_RECORDS_COUNT];
StringCopy(gStringVar1, sRecordsWindowChallengeTexts[hallFacilityId][0]);
StringExpandPlaceholders(gStringVar4, sRecordsWindowChallengeTexts[hallFacilityId][1]);
@@ -2351,13 +2351,13 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode)
gSaveBlock2Ptr->frontier.opponentNames[0][PLAYER_NAME_LENGTH] = EOS;
gSaveBlock2Ptr->frontier.opponentNames[1][PLAYER_NAME_LENGTH] = EOS;
Fill2PRecords(records2P, lvlMode);
- for (i = 0; i < 3; i++)
+ for (i = 0; i < HALL_RECORDS_COUNT; i++)
Print2PRecord(i, 1, 4, &records2P[i]);
}
else
{
Fill1PRecords(records1P, hallFacilityId, lvlMode);
- for (i = 0; i < 3; i++)
+ for (i = 0; i < HALL_RECORDS_COUNT; i++)
Print1PRecord(i, 1, 4, &records1P[i], hallFacilityId);
}
}