From b97834a03e01b03f23d1c20df99cf16a09ace3a3 Mon Sep 17 00:00:00 2001 From: Amy54Desu <69287652+Amy54Desu@users.noreply.github.com> Date: Sat, 5 Mar 2022 18:09:35 -0500 Subject: [PATCH] This should solve the problem where players can reset the drowning animation under water. (#13) This solves the issues where punching someone under water resets their drowning animation. This is done by setting their invincibility timer to 2. I chose 2 so they don't begin flashing since that would look weird. --- src/game/mario_actions_submerged.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 542c67b62..47a9c1e84 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -940,6 +940,7 @@ static s32 act_drowning(struct MarioState *m) { play_character_sound_if_no_flag(m, CHAR_SOUND_DROWNING, MARIO_ACTION_SOUND_PLAYED); stationary_slow_down(m); perform_water_step(m); + m->invincTimer = 2; return FALSE; } @@ -949,6 +950,7 @@ static s32 act_water_death(struct MarioState *m) { perform_water_step(m); m->marioBodyState->eyeState = MARIO_EYES_DEAD; + m->invincTimer = 2; set_mario_animation(m, MARIO_ANIM_WATER_DYING); if (set_mario_animation(m, MARIO_ANIM_WATER_DYING) == 35) {