diff options
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 11 |
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; |