(svn r23505) -Add: Indication in the order list if the next destination of an order is out of range.

This commit is contained in:
michi_cc
2011-12-13 00:43:48 +00:00
parent 957b643ae6
commit 708b58b484
52 changed files with 78 additions and 49 deletions

View File

@@ -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;