From 5504ceada36bfdf840552e9238c81f11ed7c3581 Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Sun, 30 Aug 2020 10:24:51 -0400 Subject: [PATCH] Change array count of pointer value to array count of the first element --- gflib/bg.c | 2 +- src/wireless_communication_status_screen.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gflib/bg.c b/gflib/bg.c index d24cdfa379..12c42d1248 100644 --- a/gflib/bg.c +++ b/gflib/bg.c @@ -34,7 +34,7 @@ struct BgConfig2 u32 unk_3:18; void* tilemap; - s32 bg_x; // Maybe unsigned, but game treats it as if it is signed a lot + s32 bg_x; // Maybe unsigned, but game treats it as if it is signed a LOT. s32 bg_y; // Same for this variable. }; diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index 0232539382..81fa16720a 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -237,7 +237,7 @@ static void PrintHeaderTexts(void) FillWindowPixelBuffer(1, PIXEL_FILL(0)); FillWindowPixelBuffer(2, PIXEL_FILL(0)); WCSS_AddTextPrinterParameterized(0, 1, sHeaderTexts[0], GetStringCenterAlignXOffset(1, sHeaderTexts[0], 0xC0), 6, COLORMODE_GREEN); - for (i = 0; i < NUM_GROUPTYPES; i++) + for (i = 0; i < (int)ARRAY_COUNT(sHeaderTexts[0]) - 1; i++) { WCSS_AddTextPrinterParameterized(1, 1, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_WHITE_LGRAY); } @@ -362,12 +362,12 @@ static u32 CountPlayersInGroupAndGetActivity(struct UnkStruct_x20 * unk20, u32 * { if (group_players(i) == 0) { - k = 0; + k = 0; //Should just be 1 without the increment after the loop ends but that doesn't match. for (j = 0; j < RFU_CHILD_MAX; j++) { if (unk20->gname_uname.gname.child_sprite_gender[j] != 0) k++; } - k++; + k++; //See above comment. groupCounts[group_type(i)] += k; } else