mirror of https://github.com/OpenTTD/OpenTTD
(svn r14726) -Fix (r14720): making new companies in network kinda failed...
parent
f8f7febe41
commit
fb7ccc6820
|
@ -813,7 +813,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
/* Has the network client a correct ClientIndex? */
|
/* Has the network client a correct ClientIndex? */
|
||||||
if (!(flags & DC_EXEC)) return CommandCost();
|
if (!(flags & DC_EXEC)) return CommandCost();
|
||||||
NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(cid);
|
NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(cid);
|
||||||
if (ci != NULL) return CommandCost();
|
if (ci == NULL) return CommandCost();
|
||||||
|
|
||||||
/* Delete multiplayer progress bar */
|
/* Delete multiplayer progress bar */
|
||||||
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
||||||
|
|
|
@ -420,8 +420,11 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't have this client_id yet, find an empty client_id, and put the data there
|
// We don't have this client_id yet, find an empty client_id, and put the data there
|
||||||
ci = NetworkFindClientInfoFromClientID(INVALID_CLIENT_ID);
|
for (int i = 0; i < MAX_CLIENT_SLOTS; i++) {
|
||||||
if (ci != NULL) {
|
ci = GetNetworkClientInfo(i);
|
||||||
|
if (!ci->IsValid()) break;
|
||||||
|
}
|
||||||
|
if (ci != GetNetworkClientInfo(MAX_CLIENT_SLOTS)) {
|
||||||
ci->client_id = client_id;
|
ci->client_id = client_id;
|
||||||
ci->client_playas = playas;
|
ci->client_playas = playas;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue