mirror of https://github.com/OpenTTD/OpenTTD.git
This commit is contained in:
parent
5176d586df
commit
935a2e5d53
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue