mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-12-31 12:01:27 +00:00
Refactor verify_warp
This commit is contained in:
parent
9fde4dc1b7
commit
c8bf12754f
1 changed files with 17 additions and 18 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue