diff src/train_cmd.cpp @ 8853:02787d6f3834 draft

(svn r12615) -Codechange: rename some enums related to depot orders to make it more clear that they are no loading/unloading flags. Also add more type strictness.
author rubidium <rubidium@openttd.org>
date Mon, 07 Apr 2008 19:18:56 +0000
parents 4859a9c43de3
children 1300bc87c872
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2109,14 +2109,14 @@
 	if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
 
 	if (v->current_order.IsType(OT_GOTO_DEPOT)) {
-		bool halt_in_depot = HasBit(v->current_order.GetDepotActionType(), OF_HALT_IN_DEPOT);
+		bool halt_in_depot = v->current_order.GetDepotActionType() & ODATFB_HALT;
 		if (!!(p2 & DEPOT_SERVICE) == halt_in_depot) {
 			/* We called with a different DEPOT_SERVICE setting.
 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
 			 * Note: the if is (true for requesting service == true for ordered to stop in depot)          */
 			if (flags & DC_EXEC) {
-				v->current_order.SetDepotOrderType(OFB_MANUAL_ORDER);
-				v->current_order.SetDepotActionType(halt_in_depot ? OFB_NORMAL_ACTION : OFB_HALT_IN_DEPOT);
+				v->current_order.SetDepotOrderType(ODTF_MANUAL);
+				v->current_order.SetDepotActionType(halt_in_depot ? ODATF_SERVICE_ONLY : ODATFB_HALT);
 				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			}
 			return CommandCost();
@@ -2126,7 +2126,7 @@
 		if (flags & DC_EXEC) {
 			/* If the orders to 'goto depot' are in the orders list (forced servicing),
 			 * then skip to the next order; effectively cancelling this forced service */
-			if (v->current_order.GetDepotOrderType() & OFB_PART_OF_ORDERS) v->cur_order_index++;
+			if (v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) v->cur_order_index++;
 
 			v->current_order.MakeDummy();
 			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
@@ -2145,8 +2145,8 @@
 		if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();
 
 		v->dest_tile = tfdd.tile;
-		v->current_order.MakeGoToDepot(GetDepotByTile(tfdd.tile)->index, false);
-		if (!(p2 & DEPOT_SERVICE)) v->current_order.SetDepotActionType(OFB_HALT_IN_DEPOT);
+		v->current_order.MakeGoToDepot(GetDepotByTile(tfdd.tile)->index, ODTF_MANUAL);
+		if (!(p2 & DEPOT_SERVICE)) v->current_order.SetDepotActionType(ODATFB_HALT);
 		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		/* If there is no depot in front, reverse automatically */
 		if (tfdd.reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
@@ -3570,7 +3570,7 @@
 		return;
 	}
 
-	v->current_order.MakeGoToDepot(depot->index, false);
+	v->current_order.MakeGoToDepot(depot->index, ODTFB_SERVICE);
 	v->dest_tile = tfdd.tile;
 	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 }