summaryrefslogtreecommitdiff
path: root/src/network/network.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network.cpp')
-rw-r--r--src/network/network.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index ba20b0895..daf2e1d3f 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -657,7 +657,7 @@ void NetworkTCPQueryServer(const std::string &connection_string, bool request_co
* @param connection_string The IP:port of the server to add.
* @return The entry on the game list.
*/
-NetworkGameList *NetworkAddServer(const std::string &connection_string)
+NetworkGameList *NetworkAddServer(const std::string &connection_string, bool manually)
{
if (connection_string.empty()) return nullptr;
@@ -666,13 +666,14 @@ NetworkGameList *NetworkAddServer(const std::string &connection_string)
if (item->info.server_name.empty()) {
ClearGRFConfigList(&item->info.grfconfig);
item->info.server_name = connection_string;
- item->manually = true;
NetworkRebuildHostList();
UpdateNetworkGameWindow();
+
+ NetworkTCPQueryServer(connection_string);
}
- NetworkTCPQueryServer(connection_string);
+ if (manually) item->manually = true;
return item;
}
@@ -1202,7 +1203,7 @@ extern "C" {
void CDECL em_openttd_add_server(const char *connection_string)
{
- NetworkAddServer(connection_string);
+ NetworkAddServer(connection_string, false);
}
}