diff options
author | truelight <truelight@openttd.org> | 2004-12-04 17:54:56 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-12-04 17:54:56 +0000 |
commit | b8f6d41418982163965dd5beb0b39dbdce1fbe8f (patch) | |
tree | 68d3e795694a875138c369707ed74b5b4b022d49 /order_cmd.c | |
parent | 0434287ef826a4ed72cd8528a52a86ae8b70a948 (diff) | |
download | openttd-b8f6d41418982163965dd5beb0b39dbdce1fbe8f.tar.xz |
(svn r942) -Merged branch/network back into the trunk
Diffstat (limited to 'order_cmd.c')
-rw-r--r-- | order_cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/order_cmd.c b/order_cmd.c index 96e39d0e2..ac91927cd 100644 --- a/order_cmd.c +++ b/order_cmd.c @@ -325,7 +325,7 @@ void RestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak) DoCommandP(0, v->index, 0, NULL, CMD_NAME_VEHICLE); } - DoCommandP(0, v->index, bak->orderindex|(bak->service_interval<<16) , NULL, CMD_RESTORE_ORDER_INDEX | CMD_ASYNC); + DoCommandP(0, v->index, bak->orderindex|(bak->service_interval<<16) , NULL, CMD_RESTORE_ORDER_INDEX); os = bak->order; if (os[0] == 0xFFFF) { @@ -333,9 +333,13 @@ void RestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak) return; } + // CMD_NO_TEST_IF_IN_NETWORK is used here, because CMD_INSERT_ORDER checks if the + // order number is one more then the current amount of orders, and because + // in network the commands are queued before send, the second insert always + // fails in test mode. By bypassing the test-mode, that no longer is a problem. ind = 0; while ((ord = *os++) != 0) { - if (!DoCommandP(0, v->index + (ind << 16), ord, NULL, CMD_INSERT_ORDER | CMD_ASYNC)) + if (!DoCommandP(0, v->index + (ind << 16), ord, NULL, CMD_INSERT_ORDER | CMD_NO_TEST_IF_IN_NETWORK)) break; ind++; } |