mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Prevent drowning after completing the level
This commit is contained in:
parent
fe1bb6f716
commit
032f53ce07
2 changed files with 6 additions and 2 deletions
|
@ -3408,7 +3408,7 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
|
||||
// Drown timer setting
|
||||
if ((p->powers[pw_shield] & SH_PROTECTWATER) // Has water protection
|
||||
|| (p->exiting) // Or exiting
|
||||
|| (p->exiting) || (p->pflags & PF_FINISHED) // Or finished/exiting
|
||||
|| (maptol & TOL_NIGHTS) // Or in NiGHTS mode
|
||||
|| (mariomode)) // Or in Mario mode...
|
||||
{
|
||||
|
|
|
@ -2153,6 +2153,10 @@ void P_DoPlayerFinish(player_t *player)
|
|||
|
||||
if (netgame)
|
||||
CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]);
|
||||
|
||||
player->powers[pw_underwater] = 0;
|
||||
player->powers[pw_spacetime] = 0;
|
||||
P_RestoreMusic(player);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2860,7 +2864,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player)
|
|||
{
|
||||
tic_t timeleft = (player->powers[pw_spacetime]) ? player->powers[pw_spacetime] : player->powers[pw_underwater];
|
||||
|
||||
if (player->exiting)
|
||||
if (player->exiting || (player->pflags & PF_FINISHED))
|
||||
player->powers[pw_underwater] = player->powers[pw_spacetime] = 0;
|
||||
|
||||
timeleft--; // The original code was all n*TICRATE + 1, so let's remove 1 tic for simplicity
|
||||
|
|
Loading…
Reference in a new issue