From aa95f61f1123a233ff0816d561ce0a826088ba84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 8 Apr 2023 13:58:59 +0200 Subject: [PATCH] Fix inconsistent client state after disconnecting with network error The `Disconnect` function did not fully clear all server data, because the client state was already set to offline manually before the function is called. This was causing inconsistent behavior when connecting to another server after being disconnected. For example, the client could get stuck at "getting game info" when connecting the next time. --- src/engine/client/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 395f18f73..5eef1053d 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2524,7 +2524,6 @@ void CClient::PumpNetwork() // check for errors if(State() != IClient::STATE_OFFLINE && State() < IClient::STATE_QUITTING && m_aNetClient[CONN_MAIN].State() == NETSTATE_OFFLINE) { - SetState(IClient::STATE_OFFLINE); Disconnect(); char aBuf[256]; str_format(aBuf, sizeof(aBuf), "offline error='%s'", m_aNetClient[CONN_MAIN].ErrorString());