Fixed crash in star seleciton

This commit is contained in:
MysterD 2022-02-15 22:03:17 -08:00
parent 25fe547113
commit 265d23892b
2 changed files with 10 additions and 6 deletions

View File

@ -111,6 +111,8 @@ void render_100_coin_star(u8 stars) {
* checks of what star should be next in sInitSelectedActNum.
*/
void bhv_act_selector_init(void) {
if (gCurrCourseNum == 0) { return; }
s16 i = 0;
s32 selectorModelIDs[10];
u8 stars = save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1);
@ -328,15 +330,17 @@ void print_act_selector_strings(void) {
#endif
}
if (currLevelName != NULL) {
#ifdef VERSION_EU
print_generic_string(get_str_x_pos_from_center(160, currLevelName + 3, 10.0f), 33, currLevelName + 3);
print_generic_string(get_str_x_pos_from_center(160, currLevelName + 3, 10.0f), 33, currLevelName + 3);
#elif defined(VERSION_SH)
lvlNameX = get_str_x_pos_from_center_scale(160, currLevelName + 3, 10.0f);
print_generic_string(lvlNameX, 33, currLevelName + 3);
lvlNameX = get_str_x_pos_from_center_scale(160, currLevelName + 3, 10.0f);
print_generic_string(lvlNameX, 33, currLevelName + 3);
#else
lvlNameX = get_str_x_pos_from_center(160, currLevelName + 3, 10.0f);
print_generic_string(lvlNameX, 33, currLevelName + 3);
lvlNameX = get_str_x_pos_from_center(160, currLevelName + 3, 10.0f);
print_generic_string(lvlNameX, 33, currLevelName + 3);
#endif
}
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);

View File

@ -47,7 +47,7 @@ s64 ns_discord_get_id(u8 localId) {
char* ns_discord_get_id_str(u8 localId) {
if (localId == UNKNOWN_LOCAL_INDEX) { localId = 0; }
static char id_str[22] = { 0 };
snprintf(id_str, 22, "%lld", gNetworkUserIds[localId]);
snprintf(id_str, 22, "%lld", (long long int)gNetworkUserIds[localId]);
return id_str;
}