From 3b2389daa4a9525c168862f396d06c3d60679895 Mon Sep 17 00:00:00 2001 From: furo Date: Sat, 30 Sep 2023 19:56:01 +0200 Subject: [PATCH] Make IsAfk attribute optional --- src/engine/shared/serverinfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/shared/serverinfo.cpp b/src/engine/shared/serverinfo.cpp index 1e7210ab0..9cccc5cf0 100644 --- a/src/engine/shared/serverinfo.cpp +++ b/src/engine/shared/serverinfo.cpp @@ -119,7 +119,6 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson) Error = Error || Country.type != json_integer; Error = Error || Score.type != json_integer; Error = Error || IsPlayer.type != json_boolean; - Error = Error || IsAfk.type != json_boolean; if(Error) { return true; @@ -132,7 +131,10 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson) pClient->m_Country = json_int_get(&Country); pClient->m_Score = json_int_get(&Score); pClient->m_IsPlayer = IsPlayer; - pClient->m_IsAfk = IsAfk; + + pClient->m_IsAfk = false; + if(IsAfk.type == json_boolean) + pClient->m_IsAfk = IsAfk; // check if a skin is also available bool HasSkin = false;