equal
deleted
inserted
replaced
12 #include "../helpers.hpp" |
12 #include "../helpers.hpp" |
13 |
13 |
14 // Add a command to the local command queue |
14 // Add a command to the local command queue |
15 void NetworkAddCommandQueue(NetworkClientState *cs, CommandPacket *cp) |
15 void NetworkAddCommandQueue(NetworkClientState *cs, CommandPacket *cp) |
16 { |
16 { |
17 CommandPacket* new_cp; |
17 CommandPacket* new_cp = MallocT<CommandPacket>(1); |
18 MallocT(&new_cp, 1); |
|
19 |
18 |
20 *new_cp = *cp; |
19 *new_cp = *cp; |
21 |
20 |
22 if (cs->command_queue == NULL) { |
21 if (cs->command_queue == NULL) { |
23 cs->command_queue = new_cp; |
22 cs->command_queue = new_cp; |
29 } |
28 } |
30 |
29 |
31 // Prepare a DoCommand to be send over the network |
30 // Prepare a DoCommand to be send over the network |
32 void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback) |
31 void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback) |
33 { |
32 { |
34 CommandPacket *c; |
33 CommandPacket *c = MallocT<CommandPacket>(1); |
35 MallocT(&c, 1); |
|
36 byte temp_callback; |
34 byte temp_callback; |
37 |
35 |
38 c->player = _local_player; |
36 c->player = _local_player; |
39 c->next = NULL; |
37 c->next = NULL; |
40 c->tile = tile; |
38 c->tile = tile; |