From 7171c5f4997702400b5e87995519de7215b004b2 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 8 Sep 2020 14:03:12 -0700 Subject: [PATCH] Prevent underwater bubble-popping from teleporting the player to the top --- src/game/mario_actions_automatic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 7ec01064..b248d7f8 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -941,7 +941,8 @@ s32 act_bubbled(struct MarioState* m) { m->vel[1] = 0; m->vel[2] = 0; m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; - return set_mario_action(m, ACT_IDLE, 0); + u8 underWater = (m->pos[1] < ((f32)m->waterLevel)); + return set_mario_action(m, underWater ? ACT_WATER_IDLE : ACT_IDLE, 0); } return FALSE;