summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-13 00:43:48 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-13 00:43:48 +0000
commit34ffd08a19e1156260223256d87a4cdfa7a080e0 (patch)
treeaa2314af8b03b75a242e3f488acf53a9b07d0a47 /src/order_cmd.cpp
parentdef8e7215bdabee99ad49adedb8730ae33b6c47f (diff)
downloadopenttd-34ffd08a19e1156260223256d87a4cdfa7a080e0.tar.xz
(svn r23505) -Add: Indication in the order list if the next destination of an order is out of range.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 44012a085..44f6f295e 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -580,7 +580,16 @@ TileIndex Order::GetLocation(const Vehicle *v, bool airport) const
}
}
-static uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth = 0)
+/**
+ * Get the distance between two orders of a vehicle. Conditional orders are resolved
+ * and the bigger distance of the two order branches is returned.
+ * @param prev Origin order.
+ * @param cur Destination order.
+ * @param v The vehicle to get the distance for.
+ * @param conditional_depth Internal param for resolving conditional orders.
+ * @return Maximum distance between the two orders.
+ */
+uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle *v, int conditional_depth)
{
if (cur->IsType(OT_CONDITIONAL)) {
if (conditional_depth > v->GetNumOrders()) return 0;