From 388470d5794996489e7000493116c7f73cc5a7a8 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 12 Sep 2020 14:32:50 -0700 Subject: [PATCH] Fixed softlocks when one player runs out of lives, or death by lava Also bubbles player when falling into quicksand Fixes #36 --- src/game/level_update.c | 1 - src/game/mario_actions_airborne.c | 2 +- src/game/mario_actions_automatic.c | 2 +- src/game/mario_actions_cutscene.c | 3 ++- src/pc/controller/controller_keyboard_debug.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/level_update.c b/src/game/level_update.c index 811d0178..c66f84f1 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -718,7 +718,6 @@ void initiate_painting_warp(void) { s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { // only allow for local player if (m != &gMarioStates[0]) { return 0; } - if (!is_player_active(m)) { return 0; } s32 val04 = TRUE; diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index 2b7c5467..c49a7383 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -1563,7 +1563,7 @@ s32 act_lava_boost(struct MarioState *m) { m->health = 0x100; } else { m->health = 0xFF; - return drop_and_set_mario_action(m, ACT_DEATH_ON_BACK, 0); + mario_set_bubbled(m); } } diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 77772d7e..e224667c 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -875,7 +875,7 @@ s32 act_bubbled(struct MarioState* m) { if (m->playerIndex == 0) { u8 allInBubble = TRUE; for (int i = 0; i < MAX_PLAYERS; i++) { - if (gMarioStates[i].action != ACT_BUBBLED) { + if (gMarioStates[i].action != ACT_BUBBLED && gMarioStates[i].health >= 0x100) { allInBubble = FALSE; break; } diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 9dfb7790..e038ccf3 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -791,7 +791,8 @@ s32 act_quicksand_death(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED); } if ((m->quicksandDepth += 5.0f) >= 180.0f) { - level_trigger_warp(m, WARP_OP_DEATH); + //level_trigger_warp(m, WARP_OP_DEATH); + mario_set_bubbled(m); m->actionState = 2; } } diff --git a/src/pc/controller/controller_keyboard_debug.c b/src/pc/controller/controller_keyboard_debug.c index f22f2e06..477615ac 100644 --- a/src/pc/controller/controller_keyboard_debug.c +++ b/src/pc/controller/controller_keyboard_debug.c @@ -5,7 +5,7 @@ #ifdef DEBUG -static u8 warpToLevel = LEVEL_BITDW; +static u8 warpToLevel = LEVEL_LLL; #define SCANCODE_0 0x0B #define SCANCODE_3 0x04