ship_cmd.c
changeset 3005 db4007baa0ab
parent 2962 dbd168a4703a
child 3139 4c950c7ec5c9
--- a/ship_cmd.c	Fri Feb 10 06:03:51 2006 +0000
+++ b/ship_cmd.c	Fri Feb 10 06:33:56 2006 +0000
@@ -203,22 +203,21 @@
 {
 	const Order *order;
 
-	if (v->current_order.type >= OT_GOTO_DEPOT &&
-			v->current_order.type <= OT_LEAVESTATION) {
-		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;
+			if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
+					!VehicleNeedsService(v)) {
+				v->cur_order_index++;
+			}
+			break;
+
+		case OT_LOADING:
+		case OT_LEAVESTATION:
 			return;
 	}
 
-	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++;
-	}
-
-
-	if (v->cur_order_index >= v->num_orders)
-		v->cur_order_index = 0;
+	if (v->cur_order_index >= v->num_orders) v->cur_order_index = 0;
 
 	order = GetVehicleOrder(v, v->cur_order_index);