(svn r9833) -Fix: also 'leave' the station when leaving for automatic servicing.

This commit is contained in:
rubidium 2007-05-14 08:07:20 +00:00
parent e72ab0fdf5
commit 42f920964b
3 changed files with 5 additions and 0 deletions

View File

@ -719,6 +719,7 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
if (st->IsValid() && st->airport_tile != 0 && st->Airport()->terminals != NULL) {
// printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
// v->u.air.targetairport = st->index;
if (v->current_order.type == OT_LOADING) v->LeaveStation();
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);

View File

@ -1686,6 +1686,9 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
return;
}
if (v->current_order.type == OT_LOADING) v->LeaveStation();
ClearSlot(v);
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
v->current_order.dest = depot->index;

View File

@ -165,6 +165,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
return;
}
if (v->current_order.type == OT_LOADING) v->LeaveStation();
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
v->current_order.dest = depot->index;