Fix disconnected players being kicked for high ping

This commit is contained in:
Louis-Antoine 2020-03-28 15:23:15 +01:00
parent 48e8c9058a
commit 8130599a4f

View file

@ -4855,7 +4855,8 @@ static inline void PingUpdate(void)
{
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)
laggers[i] = true;
@ -4874,8 +4875,8 @@ static inline void PingUpdate(void)
if (playeringame[i] && laggers[i])
{
pingtimeout[i]++;
// ok your net has been bad for too long, you deserve to die.
if (pingtimeout[i] > cv_pingtimeout.value)
// ok your net has been bad for too long, you deserve to die.
{
pingtimeout[i] = 0;
SendKick(i, KICK_MSG_PING_HIGH | KICK_MSG_KEEP_BODY);