Fix: lobby window doesn't close if no connection could be established (#9223)

This commit is contained in:
Patric Stout
2021-05-09 18:48:21 +02:00
committed by GitHub
parent e162d0a55c
commit 583011bca0
3 changed files with 48 additions and 13 deletions

View File

@@ -752,7 +752,7 @@ public:
break;
case WID_NG_REFRESH: // Refresh
if (this->server != nullptr) NetworkTCPQueryServer(this->server->connection_string);
if (this->server != nullptr) NetworkQueryServer(this->server->connection_string);
break;
case WID_NG_NEWGRF: // NewGRF Settings
@@ -1487,7 +1487,7 @@ struct NetworkLobbyWindow : public Window {
/* Clear the information so removed companies don't remain */
for (auto &company : this->company_info) company = {};
NetworkTCPQueryServer(this->server->connection_string, true);
NetworkQueryLobbyServer(this->server->connection_string);
break;
}
}
@@ -1557,7 +1557,7 @@ static void ShowNetworkLobbyWindow(NetworkGameList *ngl)
strecpy(_settings_client.network.last_joined, ngl->connection_string.c_str(), lastof(_settings_client.network.last_joined));
NetworkTCPQueryServer(ngl->connection_string, true);
NetworkQueryLobbyServer(ngl->connection_string);
new NetworkLobbyWindow(&_network_lobby_window_desc, ngl);
}