From 34ffd08a19e1156260223256d87a4cdfa7a080e0 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Tue, 13 Dec 2011 00:43:48 +0000 Subject: (svn r23505) -Add: Indication in the order list if the next destination of an order is out of range. --- src/order_cmd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/order_cmd.cpp') 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; -- cgit v1.2.3-54-g00ecf