Fix AFK being shown only for a split second when timing out

This commit is contained in:
swarfeya 2024-01-12 22:01:25 +01:00
parent 32e585b453
commit 64a70ac7a7

View file

@ -210,6 +210,8 @@ void CPlayer::Tick()
if(Server()->GetNetErrorString(m_ClientID)[0])
{
SetAfk(true);
// Ensure that the AFK state is not reset again automatically
m_LastPlaytime = time_get() - time_freq() * g_Config.m_SvMaxAfkTime - 1;
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "'%s' would have timed out, but can use timeout protection now", Server()->ClientName(m_ClientID));