diff options
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r-- | src/network/network_udp.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 0dd5971d4..32bd26923 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -490,10 +490,12 @@ void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually) // Clear item in gamelist item = NetworkGameListAddItem(inet_addr(inet_ntoa(out_addr.sin_addr)), ntohs(out_addr.sin_port)); - memset(&item->info, 0, sizeof(item->info)); - ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name)); - ttd_strlcpy(item->info.hostname, host, lengthof(item->info.hostname)); - item->online = false; + if (StrEmpty(item->info.server_name)) { + memset(&item->info, 0, sizeof(item->info)); + ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name)); + ttd_strlcpy(item->info.hostname, host, lengthof(item->info.hostname)); + item->online = false; + } item->manually = manually; // Init the packet |