summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/network_client.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index c2ddbdd39..810fdad95 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -453,6 +453,8 @@ 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) {
@@ -463,6 +465,10 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
* Do not display that for now */
}
+ /* 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);
+
ci->client_playas = playas;
strecpy(ci->client_name, name, lastof(ci->client_name));