(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 9313532ddd
commit 7f1bf45c03
8 changed files with 11 additions and 18 deletions

View File

@@ -230,12 +230,7 @@ bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const c
#ifdef ENABLE_NETWORK
/* Send the command */
if (_networking) {
/* NetworkSend_Command needs _local_company to be set correctly, so
* adjust it, and put it back right after the function */
CompanyID old_company = _local_company;
_local_company = _current_company;
::NetworkSend_Command(tile, p1, p2, cmd, CcAI, text);
_local_company = old_company;
::NetworkSend_Command(tile, p1, p2, cmd, CcAI, text, _current_company);
SetLastCost(res.GetCost());
/* Suspend the AI till the command is really executed */