mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-05 07:01:18 +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) {
|
void verify_warp(struct MarioState *m, bool killMario) {
|
||||||
if (area_get_warp_node(sSourceWarpNodeId) == NULL) {
|
if (area_get_warp_node(sSourceWarpNodeId) != NULL) { return; }
|
||||||
if (area_get_warp_node(WARP_NODE_DEATH) != NULL) {
|
|
||||||
if (killMario) {
|
if (area_get_warp_node(WARP_NODE_DEATH) == NULL) {
|
||||||
|
dynos_warp_to_start_level();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!killMario) {
|
||||||
|
sSourceWarpNodeId = WARP_NODE_DEATH;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m->numLives--;
|
m->numLives--;
|
||||||
if (m->numLives <= -1) {
|
if (m->numLives < 0) {
|
||||||
sDelayedWarpOp = WARP_OP_GAME_OVER;
|
sDelayedWarpOp = WARP_OP_GAME_OVER;
|
||||||
} else {
|
} else {
|
||||||
sSourceWarpNodeId = WARP_NODE_DEATH;
|
sSourceWarpNodeId = WARP_NODE_DEATH;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
sSourceWarpNodeId = WARP_NODE_DEATH;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dynos_warp_to_start_level();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there is not already a delayed warp, schedule one. The source node is
|
* 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.
|
* based on the warp operation and sometimes Mario's used object.
|
||||||
|
|
Loading…
Reference in a new issue