(svn r18784) -Codechange: make NetworkSend_Command accept a company instead of using _local_company to pass that information, with the whole mess when you don't want the company to be _local_company.

This commit is contained in:
rubidium
2010-01-11 20:32:32 +00:00
parent 3e5a87a52c
commit ebe99fd493
8 changed files with 11 additions and 18 deletions

View File

@@ -790,7 +790,6 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
NetworkUpdateClientInfo(ci->client_id);
if (Company::IsValidID(ci->client_playas)) {
CompanyID company_backup = _local_company;
_network_company_states[c->index].months_empty = 0;
_network_company_states[c->index].password[0] = '\0';
NetworkServerUpdateCompanyPassworded(ci->client_playas, false);
@@ -806,9 +805,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
* TODO: Perhaps this could be improved by when the client is ready
* with joining to let it send itself the command, and not the server?
* For example in network_client.c:534? */
_local_company = ci->client_playas;
NetworkSend_Command(0, 0, 0, CMD_RENAME_PRESIDENT, NULL, ci->client_name);
_local_company = company_backup;
NetworkSend_Command(0, 0, 0, CMD_RENAME_PRESIDENT, NULL, ci->client_name, ci->client_playas);
}
/* Announce new company on network, if the client was a SPECTATOR before */