diff options
author | rubidium <rubidium@openttd.org> | 2009-01-08 14:55:28 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-08 14:55:28 +0000 |
commit | e39484e9a8c2ddf93bce5b9ec5bc570c415c6000 (patch) | |
tree | 9fe08d5845cf6f8e94b83f9103044e7460ced669 /src/network | |
parent | 427e2d30c538e2edc1e9a570a2bf349b36dc5d75 (diff) | |
download | openttd-e39484e9a8c2ddf93bce5b9ec5bc570c415c6000.tar.xz |
(svn r14916) -Codechange: make it possible to send CommandContainers directly to DoCommand(P).
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_command.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 52f680aaa..4adeb92f6 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -93,16 +93,6 @@ void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, Comma } /** - * Execute a DoCommand we received from the network - * @param cp the command to execute - */ -static void NetworkExecuteCommand(CommandPacket *cp) -{ - _current_company = cp->company; - DoCommandP(cp->tile, cp->p1, cp->p2, cp->cmd | CMD_NETWORK_COMMAND, cp->callback, cp->text, cp->my_cmd); -} - -/** * Execute all commands on the local command queue that ought to be executed this frame. */ void NetworkExecuteLocalCommandQueue() @@ -119,10 +109,13 @@ void NetworkExecuteLocalCommandQueue() error("[net] Trying to execute a packet in the past!"); } + CommandPacket *cp = _local_command_queue; + /* We can execute this command */ - NetworkExecuteCommand(_local_command_queue); + _current_company = cp->company; + cp->cmd |= CMD_NETWORK_COMMAND; + DoCommandP(cp, cp->my_cmd); - CommandPacket *cp = _local_command_queue; _local_command_queue = _local_command_queue->next; free(cp); } |