Prevent drowning alert from playing for remote players

This commit is contained in:
MysterD 2020-09-21 18:24:17 -07:00
parent 5f3895463f
commit d3d13c26f8

View file

@ -1599,17 +1599,20 @@ void update_mario_health(struct MarioState *m) {
}
}
// Play a noise to alert the player when Mario is close to drowning.
if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300)) {
play_sound(SOUND_MOVING_ALMOST_DROWNING, gDefaultSoundArgs);
if (!gRumblePakTimer) {
gRumblePakTimer = 36;
if (is_rumble_finished_and_queue_empty()) {
queue_rumble_data_mario(m, 3, 30);
if (m->playerIndex == 0) {
// Play a noise to alert the player when Mario is close to drowning.
if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300)) {
play_sound(SOUND_MOVING_ALMOST_DROWNING, gDefaultSoundArgs);
if (!gRumblePakTimer) {
gRumblePakTimer = 36;
if (is_rumble_finished_and_queue_empty()) {
queue_rumble_data_mario(m, 3, 30);
}
}
}
} else {
gRumblePakTimer = 0;
else {
gRumblePakTimer = 0;
}
}
}
}