Fix crash in get_level_name()

This commit is contained in:
MysterD 2022-02-13 16:47:42 -08:00
parent 988c75d621
commit 2fea65b8ef

View file

@ -106,7 +106,7 @@ const char* get_level_name(s16 courseNum, s16 levelNum, s16 areaIndex) {
}
// If we are in in Course 0 we are in the castle which doesn't have a string
if (courseNum) {
if (courseNum && courseNum > 0 && courseNum < 27) {
void** courseNameTbl;
#ifndef VERSION_EU
@ -127,8 +127,7 @@ const char* get_level_name(s16 courseNum, s16 levelNum, s16 areaIndex) {
u8* courseName = segmented_to_virtual(courseNameTbl[courseNum - 1]);
convert_string(&courseName[3], stage);
}
else {
} else {
strcpy(stage, "Peach's Castle");
}