From b0127428c6c7726684ab4b6d938f32cc1e73ef75 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 27 Dec 2022 00:04:46 -0300 Subject: [PATCH] Review suggestions. --- src/pokemon_summary_screen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index e4d6a0aca..49d338707 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -107,6 +107,7 @@ enum { #define PSS_DATA_WINDOW_MOVE_DESCRIPTION 2 #define MOVE_SELECTOR_SPRITES_COUNT 10 +#define TYPE_ICON_SPRITE_COUNT (MAX_MON_MOVES + 1) // for the spriteIds field in PokemonSummaryScreenData enum { @@ -114,7 +115,7 @@ enum SPRITE_ARR_ID_BALL, SPRITE_ARR_ID_STATUS, SPRITE_ARR_ID_TYPE, // 2 for mon types, 5 for move types(4 moves and 1 to learn), used interchangeably, because mon types and move types aren't shown on the same screen - SPRITE_ARR_ID_MOVE_SELECTOR1 = SPRITE_ARR_ID_TYPE + 5, // 10 sprites that make up the selector + SPRITE_ARR_ID_MOVE_SELECTOR1 = SPRITE_ARR_ID_TYPE + TYPE_ICON_SPRITE_COUNT, // 10 sprites that make up the selector SPRITE_ARR_ID_MOVE_SELECTOR2 = SPRITE_ARR_ID_MOVE_SELECTOR1 + MOVE_SELECTOR_SPRITES_COUNT, SPRITE_ARR_ID_COUNT = SPRITE_ARR_ID_MOVE_SELECTOR2 + MOVE_SELECTOR_SPRITES_COUNT }; @@ -3759,7 +3760,7 @@ static void CreateMoveTypeIcons(void) { u8 i; - for (i = SPRITE_ARR_ID_TYPE; i < SPRITE_ARR_ID_MOVE_SELECTOR1; i++) + for (i = SPRITE_ARR_ID_TYPE; i < SPRITE_ARR_ID_TYPE + TYPE_ICON_SPRITE_COUNT; i++) { if (sMonSummaryScreen->spriteIds[i] == SPRITE_NONE) sMonSummaryScreen->spriteIds[i] = CreateSprite(&sSpriteTemplate_MoveTypes, 0, 0, 2);