Add null checks to initiate_delayed_warp()

This commit is contained in:
MysterD 2022-05-03 22:08:30 -07:00
parent 3fb3cbe1f1
commit 8e01c6e4ef
1 changed files with 9 additions and 7 deletions

View File

@ -975,7 +975,7 @@ void initiate_delayed_warp(void) {
if ((gCurrCreditsEntry != NULL) && (gCurrCreditsEntry->levelNum == gLevelValues.skipCreditsAt)) {
lvl_skip_credits();
} else {
} else if (gCurrCreditsEntry != NULL) {
// instance players in the credits
gCurrActStarNum = 99;
gCurrActNum = 99;
@ -991,7 +991,7 @@ void initiate_delayed_warp(void) {
if ((gCurrCreditsEntry != NULL) && (gCurrCreditsEntry->levelNum == gLevelValues.skipCreditsAt)) {
lvl_skip_credits();
} else {
} else if (gCurrCreditsEntry != NULL) {
gCurrActNum = gCurrCreditsEntry->unk02 & 0x07;
if ((gCurrCreditsEntry + 1)->levelNum == LEVEL_NONE) {
destWarpNode = WARP_NODE_CREDITS_END;
@ -1006,6 +1006,7 @@ void initiate_delayed_warp(void) {
default:
warpNode = area_get_warp_node(sSourceWarpNodeId);
if (warpNode != NULL) {
initiate_warp(warpNode->node.destLevel & 0x7F, warpNode->node.destArea,
warpNode->node.destNode, sDelayedWarpArg);
@ -1013,6 +1014,7 @@ void initiate_delayed_warp(void) {
if (sWarpDest.type != WARP_TYPE_CHANGE_LEVEL) {
level_set_transition(2, NULL);
}
}
break;
}
}