From 1967084bc3800615e6584d9d3115e0109a0e40da Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 6 Jan 2010 20:49:24 +0000 Subject: (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. --- src/network/network_gamelist.cpp | 2 +- src/network/network_udp.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2