diff --git a/src/game/level_update.c b/src/game/level_update.c index 37779e4c..fbce8510 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -834,28 +834,27 @@ void initiate_painting_warp(s16 paintingIndex) { void verify_warp(struct MarioState *m, bool killMario) { - if (area_get_warp_node(sSourceWarpNodeId) == NULL) { - if (area_get_warp_node(WARP_NODE_DEATH) != NULL) { - if (killMario) { - m->numLives--; - if (m->numLives <= -1) { - sDelayedWarpOp = WARP_OP_GAME_OVER; - } else { - sSourceWarpNodeId = WARP_NODE_DEATH; - } - } - else { - sSourceWarpNodeId = WARP_NODE_DEATH; - } - } - else { - dynos_warp_to_start_level(); - } + if (area_get_warp_node(sSourceWarpNodeId) != NULL) { return; } + + if (area_get_warp_node(WARP_NODE_DEATH) == NULL) { + dynos_warp_to_start_level(); + return; + } + + if (!killMario) { + sSourceWarpNodeId = WARP_NODE_DEATH; + return; + } + + m->numLives--; + if (m->numLives < 0) { + sDelayedWarpOp = WARP_OP_GAME_OVER; + } else { + sSourceWarpNodeId = WARP_NODE_DEATH; } } - /** * If there is not already a delayed warp, schedule one. The source node is * based on the warp operation and sometimes Mario's used object.