changeset 10478:8d4e217e7f6d draft

(svn r14733) -Fix (r14730): creating new companies didn't always work as expected.
author rubidium <rubidium@openttd.org>
date Wed, 24 Dec 2008 00:03:47 +0000
parents 20da0dd3f897
children 605b63342569
files src/company_cmd.cpp src/network/network_server.cpp
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -808,11 +808,11 @@
 			* 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 */
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -917,7 +917,7 @@
 		 * 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