mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(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
This commit is contained in:
parent
92e36c87fd
commit
519c8007c8
@ -453,8 +453,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
|
|||||||
|
|
||||||
if (MY_CLIENT->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
|
if (MY_CLIENT->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST;
|
||||||
|
|
||||||
if (!Company::IsValidID(playas)) playas = COMPANY_SPECTATOR;
|
|
||||||
|
|
||||||
ci = NetworkFindClientInfoFromClientID(client_id);
|
ci = NetworkFindClientInfoFromClientID(client_id);
|
||||||
if (ci != NULL) {
|
if (ci != NULL) {
|
||||||
if (playas == ci->client_playas && strcmp(name, ci->client_name) != 0) {
|
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,
|
/* Make sure we're in the company the server tells us to be in,
|
||||||
* for the rare case that we get moved while joining. */
|
* 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;
|
ci->client_playas = playas;
|
||||||
strecpy(ci->client_name, name, lastof(ci->client_name));
|
strecpy(ci->client_name, name, lastof(ci->client_name));
|
||||||
|
Loading…
Reference in New Issue
Block a user