(svn r16360) -Codechange: don't use _network_playas as a 'second' _local_company, but only as a storage location for the company you want to join in MP.

This commit is contained in:
rubidium
2009-05-19 21:20:14 +00:00
parent 00bc2659f2
commit 9f4d64bda0
11 changed files with 38 additions and 58 deletions

View File

@@ -714,7 +714,7 @@ public:
/* Used by clients, to connect to a server */
void NetworkClientConnectGame(NetworkAddress address)
void NetworkClientConnectGame(NetworkAddress address, CompanyID join_as)
{
if (!_network_available) return;
@@ -722,6 +722,7 @@ void NetworkClientConnectGame(NetworkAddress address)
strecpy(_settings_client.network.last_host, address.GetHostname(), lastof(_settings_client.network.last_host));
_settings_client.network.last_port = address.GetPort();
_network_join_as = join_as;
NetworkDisconnect();
NetworkInitialize();
@@ -778,9 +779,6 @@ bool NetworkServerStart()
_last_sync_frame = 0;
_network_own_client_id = CLIENT_ID_SERVER;
/* Non-dedicated server will always be company #1 */
if (!_network_dedicated) _network_playas = COMPANY_FIRST;
_network_clients_connected = 0;
NetworkInitGameInfo();
@@ -1126,6 +1124,3 @@ bool IsNetworkCompatibleVersion(const char *other)
}
#endif /* ENABLE_NETWORK */
/* NOTE: this variable needs to be always available */
CompanyID _network_playas;