Timetable: Implement autofill/automate for taken conditional orders.
Fix wrong timetable values being set after using skip or send to depot. Add timetabled flag for conditional order branch taken travel time.
This commit is contained in:
@@ -855,8 +855,10 @@ private:
|
||||
this->cur_real_order_index++;
|
||||
if (this->cur_real_order_index >= this->GetNumOrders()) this->cur_real_order_index = 0;
|
||||
} while (this->GetOrder(this->cur_real_order_index)->IsType(OT_IMPLICIT));
|
||||
this->cur_timetable_order_index = this->cur_real_order_index;
|
||||
} else {
|
||||
this->cur_real_order_index = 0;
|
||||
this->cur_timetable_order_index = INVALID_VEH_ORDER_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -931,6 +933,16 @@ public:
|
||||
return (this->orders.list == NULL) ? NULL : this->orders.list->GetOrderAt(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index of an order of the order chain, or INVALID_VEH_ORDER_ID.
|
||||
* @param order order to get the index of.
|
||||
* @return the position index of the given order, or INVALID_VEH_ORDER_ID.
|
||||
*/
|
||||
inline VehicleOrderID GetIndexOfOrder(const Order *order) const
|
||||
{
|
||||
return (this->orders.list == NULL) ? INVALID_VEH_ORDER_ID : this->orders.list->GetIndexOfOrder(order);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last order of a vehicle, or NULL if it doesn't exists
|
||||
* @return last order of a vehicle, if available
|
||||
|
||||
Reference in New Issue
Block a user