|
|
@ -2445,8 +2445,8 @@ bool Vehicle::HasUnbunchingOrder() const
|
|
|
|
static bool PreviousOrderIsUnbunching(const Vehicle *v)
|
|
|
|
static bool PreviousOrderIsUnbunching(const Vehicle *v)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* If we are headed for the first order, we must wrap around back to the last order. */
|
|
|
|
/* If we are headed for the first order, we must wrap around back to the last order. */
|
|
|
|
bool is_first_order = (v->GetOrder(v->cur_real_order_index) == v->GetFirstOrder());
|
|
|
|
bool is_first_order = (v->GetOrder(v->cur_implicit_order_index) == v->GetFirstOrder());
|
|
|
|
Order *previous_order = (is_first_order) ? v->GetLastOrder() : v->GetOrder(v->cur_real_order_index - 1);
|
|
|
|
Order *previous_order = (is_first_order) ? v->GetLastOrder() : v->GetOrder(v->cur_implicit_order_index - 1);
|
|
|
|
|
|
|
|
|
|
|
|
if (previous_order == nullptr || !previous_order->IsType(OT_GOTO_DEPOT)) return false;
|
|
|
|
if (previous_order == nullptr || !previous_order->IsType(OT_GOTO_DEPOT)) return false;
|
|
|
|
return (previous_order->GetDepotActionType() & ODATFB_UNBUNCH) != 0;
|
|
|
|
return (previous_order->GetDepotActionType() & ODATFB_UNBUNCH) != 0;
|
|
|
|