MP Jingle: Fix underwater music not restoring on air bubble or shield

This commit is contained in:
mazmazz 2018-09-21 15:42:26 -04:00
parent d14db91133
commit e0f9cdcfd1
3 changed files with 12 additions and 4 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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]--;