Always pretend cv_playersforexit is 4 in co-op special stages.
This commit is contained in:
parent
f8475eef26
commit
802ddf94b1
|
@ -10989,7 +10989,8 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
if (player->exiting == 2 || countdown2 == 2)
|
if (player->exiting == 2 || countdown2 == 2)
|
||||||
{
|
{
|
||||||
if (cv_playersforexit.value) // Count to be sure everyone's exited
|
UINT8 numneeded = (G_IsSpecialStage(gamemap) ? 4 : cv_playersforexit.value);
|
||||||
|
if (numneeded) // Count to be sure everyone's exited
|
||||||
{
|
{
|
||||||
INT32 i, total = 0, exiting = 0;
|
INT32 i, total = 0, exiting = 0;
|
||||||
|
|
||||||
|
@ -11005,7 +11006,7 @@ void P_PlayerThink(player_t *player)
|
||||||
exiting++;
|
exiting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!total || ((4*exiting)/total) >= cv_playersforexit.value)
|
if (!total || ((4*exiting)/total) >= numneeded)
|
||||||
{
|
{
|
||||||
if (server)
|
if (server)
|
||||||
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
||||||
|
|
|
@ -2100,39 +2100,43 @@ static void ST_drawTextHUD(void)
|
||||||
textHUDdraw(M_GetText("\x82""FIRE:""\x80 Enter game"))
|
textHUDdraw(M_GetText("\x82""FIRE:""\x80 Enter game"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gametype == GT_COOP && (!stplyr->spectator || (!(maptol & TOL_NIGHTS) && G_IsSpecialStage(gamemap))) && stplyr->exiting && cv_playersforexit.value)
|
if (gametype == GT_COOP && (!stplyr->spectator || (!(maptol & TOL_NIGHTS) && G_IsSpecialStage(gamemap))) && stplyr->exiting)
|
||||||
{
|
{
|
||||||
INT32 i, total = 0, exiting = 0;
|
UINT8 numneeded = (G_IsSpecialStage(gamemap) ? 4 : cv_playersforexit.value);
|
||||||
|
if (numneeded)
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator)
|
INT32 i, total = 0, exiting = 0;
|
||||||
continue;
|
|
||||||
if (players[i].lives <= 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
total++;
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (players[i].exiting)
|
|
||||||
exiting++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cv_playersforexit.value != 4)
|
|
||||||
{
|
|
||||||
total *= cv_playersforexit.value;
|
|
||||||
if (total & 3)
|
|
||||||
total += 4; // round up
|
|
||||||
total /= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exiting < total)
|
|
||||||
{
|
|
||||||
if (!splitscreen && !donef12)
|
|
||||||
{
|
{
|
||||||
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
|
if (!playeringame[i] || players[i].spectator)
|
||||||
donef12 = true;
|
continue;
|
||||||
|
if (players[i].lives <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
total++;
|
||||||
|
if (players[i].exiting)
|
||||||
|
exiting++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numneeded != 4)
|
||||||
|
{
|
||||||
|
total *= cv_playersforexit.value;
|
||||||
|
if (total & 3)
|
||||||
|
total += 4; // round up
|
||||||
|
total /= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exiting < total)
|
||||||
|
{
|
||||||
|
if (!splitscreen && !donef12)
|
||||||
|
{
|
||||||
|
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
|
||||||
|
donef12 = true;
|
||||||
|
}
|
||||||
|
total -= exiting;
|
||||||
|
textHUDdraw(va(M_GetText("%d player%s remaining"), total, ((total == 1) ? "" : "s")))
|
||||||
}
|
}
|
||||||
total -= exiting;
|
|
||||||
textHUDdraw(va(M_GetText("%d player%s remaining"), total, ((total == 1) ? "" : "s")))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (!stplyr->spectator))
|
else if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (!stplyr->spectator))
|
||||||
|
|
Loading…
Reference in New Issue