Make warp surfaces use the force parameter if set (#525)

This commit is contained in:
Reonu
2022-11-03 00:25:24 +01:00
committed by GitHub
parent ab94fd7f63
commit 088dbbdd2b
3 changed files with 16 additions and 11 deletions

View File

@@ -743,17 +743,21 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
break;
case WARP_OP_WARP_FLOOR:
sSourceWarpNodeId = WARP_NODE_WARP_FLOOR;
if (area_get_warp_node(sSourceWarpNodeId) == NULL) {
if ((m->floor) && (m->floor->force & 0xFF)) {
sSourceWarpNodeId = m->floor->force & 0xFF;
} else {
sSourceWarpNodeId = WARP_NODE_WARP_FLOOR;
if (area_get_warp_node(sSourceWarpNodeId) == NULL) {
#ifdef ENABLE_LIVES
if (m->numLives == 0) {
sDelayedWarpOp = WARP_OP_GAME_OVER;
} else {
sSourceWarpNodeId = WARP_NODE_DEATH;
}
if (m->numLives == 0) {
sDelayedWarpOp = WARP_OP_GAME_OVER;
} else {
sSourceWarpNodeId = WARP_NODE_DEATH;
}
#else
sSourceWarpNodeId = WARP_NODE_DEATH;
sSourceWarpNodeId = WARP_NODE_DEATH;
#endif
}
}
sDelayedWarpTimer = 20;