diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -2274,21 +2274,20 @@ static bool ProcessTrainOrder(Vehicle *v const Order *order; bool result; - // These are un-interruptible - if (v->current_order.type >= OT_GOTO_DEPOT && - v->current_order.type <= OT_LEAVESTATION) { - // Let a depot order in the orderlist interrupt. - if (v->current_order.type != OT_GOTO_DEPOT || - !(v->current_order.flags & OF_UNLOAD)) + switch (v->current_order.type) { + case OT_GOTO_DEPOT: + if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return false; + if ((v->current_order.flags & OF_SERVICE_IF_NEEDED) && + !VehicleNeedsService(v)) { + v->cur_order_index++; + } + break; + + case OT_LOADING: + case OT_LEAVESTATION: return false; } - if (v->current_order.type == OT_GOTO_DEPOT && - (v->current_order.flags & (OF_PART_OF_ORDERS | OF_SERVICE_IF_NEEDED)) == (OF_PART_OF_ORDERS | OF_SERVICE_IF_NEEDED) && - !VehicleNeedsService(v)) { - v->cur_order_index++; - } - // check if we've reached the waypoint? if (v->current_order.type == OT_GOTO_WAYPOINT && v->tile == v->dest_tile) { v->cur_order_index++;