summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-06 20:49:24 +0000
committerrubidium <rubidium@openttd.org>2010-01-06 20:49:24 +0000
commit1967084bc3800615e6584d9d3115e0109a0e40da (patch)
treecb79c4ab76d138c6e0caf9a086f1bb8862dda899
parent9c4b5e32fa11691946738d82cf8b0879c3574d00 (diff)
downloadopenttd-1967084bc3800615e6584d9d3115e0109a0e40da.tar.xz
(svn r18746) -Fix [FS#3489]: clear the cached NewGRFs of a server when receiving a reply instead of when requesting the information. With slow/unstable network connections it would look like the NewGRF settings button went randomly missing.
-rw-r--r--src/network/network_gamelist.cpp2
-rw-r--r--src/network/network_udp.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp
index f0a3fb5c9..62fbc822b 100644
--- a/src/network/network_gamelist.cpp
+++ b/src/network/network_gamelist.cpp
@@ -49,8 +49,8 @@ static void NetworkGameListHandleDelayedInsert()
NetworkGameList *item = NetworkGameListAddItem(ins_item->address);
if (item != NULL) {
- ClearGRFConfigList(&item->info.grfconfig);
if (StrEmpty(item->info.server_name)) {
+ ClearGRFConfigList(&item->info.grfconfig);
memset(&item->info, 0, sizeof(item->info));
strecpy(item->info.server_name, ins_item->info.server_name, lastof(item->info.server_name));
strecpy(item->info.hostname, ins_item->info.hostname, lastof(item->info.hostname));
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index b9d812ede..be6e01e33 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -237,6 +237,7 @@ DEF_UDP_RECEIVE_COMMAND(Client, PACKET_UDP_SERVER_RESPONSE)
/* Find next item */
item = NetworkGameListAddItem(*client_addr);
+ ClearGRFConfigList(&item->info.grfconfig);
this->Recv_NetworkGameInfo(p, &item->info);
item->info.compatible = true;