@@ -809,24 +809,26 @@ CommandCost CmdSetAutoReplace(TileIndex
* - #2 p2 = (bit 16-31) - player to be merged into ((p2>>16)&0xFFFF)
* @todo In the case of p1=0, create new player, the clientID of the new player is in parameter
* p2. This parameter is passed in at function DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND)
* on the server itself. First of all this is unbelievably ugly; second of all, well,
* it IS ugly! <b>Someone fix this up :)</b> So where to fix?@n
* @arg - network_server.c:838 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND)@n
* @arg - network_client.c:536 DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) from where the map has been received
*/
CommandCost CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
if (flags & DC_EXEC) _current_player = OWNER_NONE;
InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0);
switch (p1) {
case 0: { /* Create a new player */
/* Joining Client:
* _local_player: PLAYER_SPECTATOR
* _network_playas/cid = requested company/player
*
* Other client(s)/server:
* _local_player/_network_playas: what they play as
* cid = requested company/player of joining client */
Player *p;
#ifdef ENABLE_NETWORK
uint16 cid = p2; // ClientID