mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-20 18:01:16 +00:00
Ignore disconnected players in tag gametypes
Disconnected players do not become IT at round start. If all non-ITs are disconnected, the round ends. If all ITs are disconnected, one of the non-ITs becomes IT, or the round ends if in Hide & Seek.
This commit is contained in:
parent
ce20642fa7
commit
b0b22b53d6
3 changed files with 7 additions and 3 deletions
|
@ -2257,9 +2257,9 @@ void P_CheckSurvivors(void)
|
|||
{
|
||||
if (players[i].spectator)
|
||||
spectators++;
|
||||
else if (players[i].pflags & PF_TAGIT)
|
||||
else if ((players[i].pflags & PF_TAGIT) && players[i].quittime < 30 * TICRATE)
|
||||
taggers++;
|
||||
else if (!(players[i].pflags & PF_GAMETYPEOVER))
|
||||
else if (!(players[i].pflags & PF_GAMETYPEOVER) && players[i].quittime < 30 * TICRATE)
|
||||
{
|
||||
survivorarray[survivors] = i;
|
||||
survivors++;
|
||||
|
|
|
@ -3097,7 +3097,7 @@ static void P_InitTagGametype(void)
|
|||
//Also, you'd never have to loop through all 32 players slots to find anything ever again.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
if (playeringame[i] && !(players[i].spectator && players[i].quittime))
|
||||
{
|
||||
playersactive[realnumplayers] = i; //stores the player's node in the array.
|
||||
realnumplayers++;
|
||||
|
|
|
@ -599,6 +599,10 @@ void P_Ticker(boolean run)
|
|||
if (players[i].quittime)
|
||||
{
|
||||
players[i].quittime++;
|
||||
|
||||
if (players[i].quittime == 30 * TICRATE)
|
||||
P_CheckSurvivors();
|
||||
|
||||
if (server && players[i].quittime >= FixedMul(cv_rejointimeout.value, 60 * TICRATE))
|
||||
SendKick(i, KICK_MSG_PLAYER_QUIT);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue