summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-04-20 23:12:32 +0000
committeryexo <yexo@openttd.org>2009-04-20 23:12:32 +0000
commita664a2668cdfc0901ce2bf75b698960fab18d9c0 (patch)
tree1bcdee9b1553414a006bdeb6363266c817ae416e
parent37cce7098b93bc4e0a8581aad6dd5f8f09fe36e0 (diff)
downloadopenttd-a664a2668cdfc0901ce2bf75b698960fab18d9c0.tar.xz
(svn r16106) -Fix [NoAI]: AIOrder::SetOrderFlags always removed "Service if needed" from goto-depot orders.
-rw-r--r--src/ai/api/ai_order.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index 72856946d..9278b9f82 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -358,7 +358,9 @@ static void _DoCommandReturnSetOrderFlags(class AIInstance *instance)
switch (order->GetType()) {
case OT_GOTO_DEPOT:
if ((current & AIOF_SERVICE_IF_NEEDED) != (order_flags & AIOF_SERVICE_IF_NEEDED)) {
- return AIObject::DoCommand(0, vehicle_id | (order_position << 16), MOF_DEPOT_ACTION, CMD_MODIFY_ORDER, NULL, &_DoCommandReturnSetOrderFlags);
+ uint data = DA_ALWAYS_GO;
+ if (order_flags & AIOF_SERVICE_IF_NEEDED) data = DA_SERVICE;
+ return AIObject::DoCommand(0, vehicle_id | (order_position << 16), (data << 4) | MOF_DEPOT_ACTION, CMD_MODIFY_ORDER, NULL, &_DoCommandReturnSetOrderFlags);
}
break;