summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_order.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-03-12 11:43:40 +0000
committeryexo <yexo@openttd.org>2009-03-12 11:43:40 +0000
commitcef662825b27f5c934efeadd6112888e8b97a061 (patch)
tree036f263970898122c11bfe14edff539e64fb1b9e /src/ai/api/ai_order.cpp
parent9eef8f77e2ed4a8fe297b70feb69cf311b906a91 (diff)
downloadopenttd-cef662825b27f5c934efeadd6112888e8b97a061.tar.xz
(svn r15684) -Add [NoAI]: AIOrder::SkipToOrder().
Diffstat (limited to 'src/ai/api/ai_order.cpp')
-rw-r--r--src/ai/api/ai_order.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index e22c08ea1..2e901ea0a 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -306,6 +306,13 @@ static OrderType GetOrderTypeByTile(TileIndex t)
return AIObject::DoCommand(0, vehicle_id, order_position, CMD_DELETE_ORDER);
}
+/* static */ bool AIOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order)
+{
+ EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order));
+
+ return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
+}
+
/**
* Callback handler as SetOrderFlags possibly needs multiple DoCommand calls
* to be able to set all order flags correctly. As we need to wait till the