changeset 6613:56311d41de3a draft

(svn r9833) -Fix: also 'leave' the station when leaving for automatic servicing.
author rubidium <rubidium@openttd.org>
date Mon, 14 May 2007 08:07:20 +0000
parents 396c4f7ad60a
children 38491982a7d2
files src/aircraft_cmd.cpp src/roadveh_cmd.cpp src/ship_cmd.cpp
diffstat 3 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -719,6 +719,7 @@
 	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);
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1686,6 +1686,9 @@
 		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;
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -165,6 +165,7 @@
 		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;