diff options
author | truelight <truelight@openttd.org> | 2004-12-20 16:02:01 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-12-20 16:02:01 +0000 |
commit | 5f25a0788a319c16d331ce4dcbdbc874ab8e0536 (patch) | |
tree | 0af8a168a8079b09ae4398464cf72f5fa503a523 /network_client.c | |
parent | 7460764d91f842789a643e82360d4a4b09bc22b3 (diff) | |
download | openttd-5f25a0788a319c16d331ce4dcbdbc874ab8e0536.tar.xz |
(svn r1186) -Fix: [Network] You can now join a company on a server where a company
went bankrupt, without joining the wrong company (or even failing to do so)
Diffstat (limited to 'network_client.c')
-rw-r--r-- | network_client.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/network_client.c b/network_client.c index 4730aab5e..e5a4d600d 100644 --- a/network_client.c +++ b/network_client.c @@ -275,16 +275,17 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_COMPANY_INFO) byte current; total = NetworkRecv_uint8(p); - _network_lobby_company_count = total; // There is no data at all.. if (total == 0) return NETWORK_RECV_STATUS_CLOSE_QUERY; - current = NetworkRecv_uint8(p) - 1; + current = NetworkRecv_uint8(p); if (current >= MAX_PLAYERS) return NETWORK_RECV_STATUS_CLOSE_QUERY; + _network_lobby_company_count++; + NetworkRecv_string(p, _network_player_info[current].company_name, sizeof(_network_player_info[current].company_name)); _network_player_info[current].inaugurated_year = NetworkRecv_uint8(p); _network_player_info[current].company_value = NetworkRecv_uint64(p); @@ -300,11 +301,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_COMPANY_INFO) InvalidateWindow(WC_NETWORK_WINDOW, 0); - if (total == current + 1) - // This was the last one - return NETWORK_RECV_STATUS_CLOSE_QUERY; - else - return NETWORK_RECV_STATUS_OKAY; + return NETWORK_RECV_STATUS_OKAY; } return NETWORK_RECV_STATUS_CLOSE_QUERY; |