From e0f9cdcfd1a78edea2fbb5c81adc1a9d3587f572 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 21 Sep 2018 15:42:26 -0400 Subject: [PATCH] MP Jingle: Fix underwater music not restoring on air bubble or shield --- src/p_enemy.c | 7 +++++-- src/p_inter.c | 2 ++ src/p_user.c | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index ceeb6c97d..1f57d1901 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3227,9 +3227,12 @@ void A_WaterShield(mobj_t *actor) } if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) + { + player->powers[pw_underwater] = 0; P_RestoreMusic(player); - - player->powers[pw_underwater] = 0; + } + else + player->powers[pw_underwater] = 0; if (player->powers[pw_spacetime] > 1) player->powers[pw_spacetime] = 0; diff --git a/src/p_inter.c b/src/p_inter.c index 7a17fbcf6..2c5c85ed3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1429,7 +1429,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Eaten by player! if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) + player->powers[pw_underwater] = underwatertics + 1; P_RestoreMusic(player); + } if (player->powers[pw_underwater] < underwatertics + 1) player->powers[pw_underwater] = underwatertics + 1; diff --git a/src/p_user.c b/src/p_user.c index ea58b7eeb..f41459147 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9185,9 +9185,12 @@ void P_PlayerThink(player_t *player) if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) { if (player->powers[pw_underwater] <= 12*TICRATE+1) + { + player->powers[pw_underwater] = 0; P_RestoreMusic(player); //incase they were about to drown - - player->powers[pw_underwater] = 0; + } + else + player->powers[pw_underwater] = 0; } else if (player->powers[pw_underwater] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_underwater]--;