Fix end-of-level fading for cv_playersforexit

(Code in p_user.c was from 2.2, where cv_playersforexit has different values so that the player exit check works differently)
This commit is contained in:
mazmazz 2019-03-15 03:47:30 -04:00
parent a1ccb8512d
commit 587a51a957
1 changed files with 4 additions and 5 deletions

View File

@ -8836,7 +8836,7 @@ void P_PlayerThink(player_t *player)
{ {
if (cv_playersforexit.value) if (cv_playersforexit.value)
{ {
INT32 i, total = 0, exiting = 0; INT32 i;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
@ -8845,12 +8845,11 @@ void P_PlayerThink(player_t *player)
if (players[i].lives <= 0) if (players[i].lives <= 0)
continue; continue;
total++; if (!players[i].exiting || players[i].exiting > 1*TICRATE)
if (players[i].exiting && players[i].exiting < 1*TICRATE+1) break;
exiting++;
} }
if (!total || ((4*exiting)/total) >= cv_playersforexit.value) if (i == MAXPLAYERS)
{ {
exitfadestarted = true; exitfadestarted = true;
S_FadeOutStopMusic(1*MUSICRATE); S_FadeOutStopMusic(1*MUSICRATE);