summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-04-20 11:29:51 +0000
committerrubidium <rubidium@openttd.org>2010-04-20 11:29:51 +0000
commit519c8007c83098fa595ad727386a31ae992c581a (patch)
treed1de463119a805f3d61a51ff1a9cfcd301984d75 /src/network
parent92e36c87fd77ed9b9de958e9f211aa105a76ca9f (diff)
downloadopenttd-519c8007c83098fa595ad727386a31ae992c581a.tar.xz
(svn r19680) -Fix [FS#3775] (r19648): when joining a MP game all clients with company ID > 0 would be shown as if they were a spectator
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_client.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index dc4e46691..19f07ae64 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -453,8 +453,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
if (MY_CLIENT->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
- if (!Company::IsValidID(playas)) playas = COMPANY_SPECTATOR;
-
ci = NetworkFindClientInfoFromClientID(client_id);
if (ci != NULL) {
if (playas == ci->client_playas && strcmp(name, ci->client_name) != 0) {
@@ -467,7 +465,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
/* Make sure we're in the company the server tells us to be in,
* for the rare case that we get moved while joining. */
- if (client_id == _network_own_client_id) SetLocalCompany(playas);
+ if (client_id == _network_own_client_id) SetLocalCompany(!Company::IsValidID(playas) ? COMPANY_SPECTATOR : playas);
ci->client_playas = playas;
strecpy(ci->client_name, name, lastof(ci->client_name));