--- a/src/timetable_gui.cpp Sun Apr 06 14:12:19 2008 +0000
+++ b/src/timetable_gui.cpp Sun Apr 06 23:07:42 2008 +0000
@@ -79,7 +79,7 @@
w->EnableWidget(TTV_CLEAR_TIME);
} else {
const Order *order = GetVehicleOrder(v, (selected + 1) / 2);
- bool disable = order == NULL || order->type != OT_GOTO_STATION || (_patches.new_nonstop && (order->flags & OFB_NON_STOP));
+ bool disable = order == NULL || !order->IsType(OT_GOTO_STATION) || (_patches.new_nonstop && (order->GetNonStopType() & OFB_NON_STOP));
w->SetWidgetDisabledState(TTV_CHANGE_TIME, disable);
w->SetWidgetDisabledState(TTV_CLEAR_TIME, disable);
@@ -113,14 +113,14 @@
if (i % 2 == 0) {
SetDParam(2, STR_EMPTY);
- switch (order->type) {
+ switch (order->GetType()) {
case OT_DUMMY:
SetDParam(0, STR_INVALID_ORDER);
break;
case OT_GOTO_STATION:
- SetDParam(0, (order->flags & OFB_NON_STOP) ? STR_880A_GO_NON_STOP_TO : STR_8806_GO_TO);
- SetDParam(1, order->dest);
+ SetDParam(0, (order->GetNonStopType() & OFB_NON_STOP) ? STR_880A_GO_NON_STOP_TO : STR_8806_GO_TO);
+ SetDParam(1, order->GetDestination());
if (order->wait_time > 0) {
SetDParam(2, STR_TIMETABLE_STAY_FOR);
@@ -134,26 +134,26 @@
if (v->type == VEH_AIRCRAFT) {
string = STR_GO_TO_AIRPORT_HANGAR;
- SetDParam(1, order->dest);
+ SetDParam(1, order->GetDestination());
} else {
- SetDParam(1, GetDepot(order->dest)->town_index);
+ SetDParam(1, GetDepot(order->GetDestination())->town_index);
switch (v->type) {
- case VEH_TRAIN: string = (order->flags & OFB_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
+ case VEH_TRAIN: string = (order->GetNonStopType() & OFB_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
case VEH_ROAD: string = STR_GO_TO_ROADVEH_DEPOT; break;
case VEH_SHIP: string = STR_GO_TO_SHIP_DEPOT; break;
default: break;
}
}
- if (order->flags & OFB_FULL_LOAD) string++; // Service at orders
+ if (order->GetDepotOrderType() & OFB_SERVICE_IF_NEEDED) string++; /* service at */
SetDParam(0, string);
} break;
case OT_GOTO_WAYPOINT:
- SetDParam(0, (order->flags & OFB_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
- SetDParam(1, order->dest);
+ SetDParam(0, (order->GetNonStopType() & OFB_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
+ SetDParam(1, order->GetDestination());
break;
default: break;
@@ -197,7 +197,7 @@
for (const Order *order = GetVehicleOrder(v, 0); order != NULL; order = order->next) {
total_time += order->travel_time + order->wait_time;
if (order->travel_time == 0) complete = false;
- if (order->wait_time == 0 && order->type == OT_GOTO_STATION && !(_patches.new_nonstop && (order->flags & OFB_NON_STOP))) complete = false;
+ if (order->wait_time == 0 && order->IsType(OT_GOTO_STATION) && !(_patches.new_nonstop && (order->GetNonStopType() & OFB_NON_STOP))) complete = false;
}
if (total_time != 0) {