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.
This commit is contained in:
Amy54Desu 2022-03-05 18:09:35 -05:00 committed by GitHub
parent d37ba32989
commit b97834a03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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) {