mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r14733) -Fix (r14730): creating new companies didn't always work as expected.
This commit is contained in:
parent
c3746a55bb
commit
4a1f4144eb
|
@ -808,11 +808,11 @@ CommandCost CmdCompanyCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
* Other client(s)/server:
|
||||
* _local_company/_network_playas: what they play as
|
||||
* cid = requested company/company of joining client */
|
||||
ClientIndex cid = (ClientIndex)p2;
|
||||
ClientID cid = (ClientID)p2;
|
||||
|
||||
/* Has the network client a correct ClientIndex? */
|
||||
if (!(flags & DC_EXEC)) return CommandCost();
|
||||
NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(cid);
|
||||
NetworkClientInfo *ci = NetworkFindClientInfoFromClientID(cid);
|
||||
if (ci == NULL) return CommandCost();
|
||||
|
||||
/* Delete multiplayer progress bar */
|
||||
|
|
|
@ -917,7 +917,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND)
|
|||
* spectator, but that is not allowed any commands. So do an impersonation. The drawback
|
||||
* of this is that the first company's last_built_tile is also updated... */
|
||||
cp->company = OWNER_BEGIN;
|
||||
cp->p2 = cs->index; // XXX - UGLY! p2 is mis-used to get the client-id in CmdCompanyCtrl
|
||||
cp->p2 = cs->client_id;
|
||||
}
|
||||
|
||||
// The frame can be executed in the same frame as the next frame-packet
|
||||
|
|
Loading…
Reference in New Issue