Merge branch 'fix-keepbody-ping' into 'master'

Fix disconnected players being kicked for high ping

See merge request STJr/SRB2!866
This commit is contained in:
SteelT 2020-03-31 20:25:43 -04:00
commit b6f1155ae1

View file

@ -4855,7 +4855,8 @@ static inline void PingUpdate(void)
{ {
for (i = 1; i < MAXPLAYERS; i++) for (i = 1; i < MAXPLAYERS; i++)
{ {
if (playeringame[i] && (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value)) if (playeringame[i] && !players[i].quittime
&& (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value))
{ {
if (players[i].jointime > 30 * TICRATE) if (players[i].jointime > 30 * TICRATE)
laggers[i] = true; laggers[i] = true;
@ -4874,8 +4875,8 @@ static inline void PingUpdate(void)
if (playeringame[i] && laggers[i]) if (playeringame[i] && laggers[i])
{ {
pingtimeout[i]++; pingtimeout[i]++;
if (pingtimeout[i] > cv_pingtimeout.value)
// ok your net has been bad for too long, you deserve to die. // ok your net has been bad for too long, you deserve to die.
if (pingtimeout[i] > cv_pingtimeout.value)
{ {
pingtimeout[i] = 0; pingtimeout[i] = 0;
SendKick(i, KICK_MSG_PING_HIGH | KICK_MSG_KEEP_BODY); SendKick(i, KICK_MSG_PING_HIGH | KICK_MSG_KEEP_BODY);