fix custom level corruption on network shutdown (#174)

This commit is contained in:
Isaac0-dev 2022-08-26 13:16:01 +10:00 committed by GitHub
parent fa5414d386
commit 0bb66abe61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 6 deletions

View File

@ -1340,11 +1340,15 @@ void update_menu_level(void) {
// warp to level, this feels buggy
if (gCurrLevelNum != curLevel) {
if (curLevel == LEVEL_JRB) {
dynos_warp_to_level(curLevel, 1, 2);
gChangeLevel = curLevel;
gChangeActNum = 2;
} else if (curLevel == LEVEL_THI) {
dynos_warp_to_level(curLevel, 2, 6);
gChangeLevel = curLevel;
gChangeAreaIndex = 2;
gChangeActNum = 6;
} else {
dynos_warp_to_level(curLevel, 1, 6);
gChangeLevel = curLevel;
gChangeActNum = 6;
}
}
@ -1452,11 +1456,15 @@ void update_menu_level(void) {
if (get_current_background_music() == 0x0021) {
if (curLevel == LEVEL_JRB) {
dynos_warp_to_level(curLevel, 1, 2);
gChangeLevel = curLevel;
gChangeActNum = 2;
} else if (curLevel == LEVEL_THI) {
dynos_warp_to_level(curLevel, 2, 6);
gChangeLevel = curLevel;
gChangeAreaIndex = 2;
gChangeActNum = 6;
} else {
dynos_warp_to_level(curLevel, 1, 6);
gChangeLevel = curLevel;
gChangeActNum = 6;
}
}
}
@ -1720,6 +1728,10 @@ s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum) {
disable_warp_checkpoint();
}
if (gDjuiInMainMenu) {
return 0;
}
if (foundHook) {
return hookUseActSelect;
}