(svn r9833) -Fix: also 'leave' the station when leaving for automatic servicing.
authorrubidium
Mon, 14 May 2007 08:07:20 +0000
changeset 6613 1f914b423535
parent 6612 35c124ef9ddb
child 6614 abe46ba511ba
(svn r9833) -Fix: also 'leave' the station when leaving for automatic servicing.
src/aircraft_cmd.cpp
src/roadveh_cmd.cpp
src/ship_cmd.cpp
--- a/src/aircraft_cmd.cpp	Sun May 13 22:10:04 2007 +0000
+++ b/src/aircraft_cmd.cpp	Mon May 14 08:07:20 2007 +0000
@@ -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	Sun May 13 22:10:04 2007 +0000
+++ b/src/roadveh_cmd.cpp	Mon May 14 08:07:20 2007 +0000
@@ -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	Sun May 13 22:10:04 2007 +0000
+++ b/src/ship_cmd.cpp	Mon May 14 08:07:20 2007 +0000
@@ -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;