From 156cca96079652357ab0c2fea7046c678f06284b Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:27:18 +1000 Subject: [PATCH] fix course naming again (#515) * fix course naming again whoops that was my fault (hopefully for the last time) * +1 course index in pause_castle_get_stars --- include/course_table.h | 2 +- src/game/ingame_menu.c | 2 +- src/game/level_info.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/course_table.h b/include/course_table.h index af2976824..8630c6e51 100644 --- a/include/course_table.h +++ b/include/course_table.h @@ -28,7 +28,7 @@ enum CourseNum #undef DEFINE_BONUS_COURSE #define COURSE_IS_MAIN_COURSE(cmd) (cmd >= COURSE_MIN && cmd <= COURSE_STAGES_MAX) -#define COURSE_IS_VALID_COURSE(cmd) (cmd >= COURSE_MIN && cmd <= COURSE_MAX) +#define COURSE_IS_VALID_COURSE(cmd) (cmd >= COURSE_MIN && cmd < COURSE_MAX) #endif // COURSE_TABLE_H diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 9b9374c96..1064656b7 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -2873,7 +2873,7 @@ void render_pause_castle_main_strings(s16 x, s16 y) { static u32 pause_castle_get_stars(s32 index) { // Main courses (0-14), Secret courses (15-24) - if (COURSE_IS_VALID_COURSE(index)) { + if (COURSE_IS_VALID_COURSE(index + 1)) { return save_file_get_star_flags(gCurrSaveFileNum - 1, index); } diff --git a/src/game/level_info.c b/src/game/level_info.c index 112f5e67d..922ef1014 100644 --- a/src/game/level_info.c +++ b/src/game/level_info.c @@ -207,7 +207,7 @@ const char *get_level_name_ascii(s16 courseNum, s16 levelNum, s16 areaIndex, s16 } else if (!hasCustomName) { - if (COURSE_IS_MAIN_COURSE(courseNum)) { + if (COURSE_IS_VALID_COURSE(courseNum)) { void **courseNameTbl = get_course_name_table(); const u8 *courseName = segmented_to_virtual(courseNameTbl[courseNum - COURSE_BOB]); convert_string_sm64_to_ascii(output, courseName + 3);