summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-07 19:18:56 +0000
committerrubidium <rubidium@openttd.org>2008-04-07 19:18:56 +0000
commitf1cd7ef5ee9d0862622d53a4c348d6f9debd500e (patch)
tree107ad3411123e54f1869835417c772620cee3502 /src/roadveh_cmd.cpp
parent45165fe075f9eb4234ea876fc5695a422eced66e (diff)
downloadopenttd-f1cd7ef5ee9d0862622d53a4c348d6f9debd500e.tar.xz
(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.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 4eceebb64..fba9831cc 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -477,14 +477,14 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
/* If the current orders are already goto-depot */
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();
@@ -494,7 +494,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
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);
@@ -509,8 +509,8 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();
ClearSlot(v);
- v->current_order.MakeGoToDepot(dep->index, false);
- if (!(p2 & DEPOT_SERVICE)) v->current_order.SetDepotActionType(OFB_HALT_IN_DEPOT);
+ v->current_order.MakeGoToDepot(dep->index, ODTF_MANUAL);
+ if (!(p2 & DEPOT_SERVICE)) v->current_order.SetDepotActionType(ODATFB_HALT);
v->dest_tile = dep->xy;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
@@ -1937,7 +1937,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();
ClearSlot(v);
- v->current_order.MakeGoToDepot(depot->index, false);
+ v->current_order.MakeGoToDepot(depot->index, ODTFB_SERVICE);
v->dest_tile = depot->xy;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}