22 order->travel_time = time; |
22 order->travel_time = time; |
23 } else { |
23 } else { |
24 order->wait_time = time; |
24 order->wait_time = time; |
25 } |
25 } |
26 |
26 |
27 if (v->cur_order_index == order_number && HasBit(v->current_order.flags, OF_PART_OF_ORDERS)) { |
27 if (v->cur_order_index == order_number && v->current_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) { |
28 if (is_journey) { |
28 if (is_journey) { |
29 v->current_order.travel_time = time; |
29 v->current_order.travel_time = time; |
30 } else { |
30 } else { |
31 v->current_order.wait_time = time; |
31 v->current_order.wait_time = time; |
32 } |
32 } |
67 if (order == NULL) return CMD_ERROR; |
67 if (order == NULL) return CMD_ERROR; |
68 |
68 |
69 bool packed_time = HasBit(p1, 25); |
69 bool packed_time = HasBit(p1, 25); |
70 bool is_journey = HasBit(p1, 24) || packed_time; |
70 bool is_journey = HasBit(p1, 24) || packed_time; |
71 if (!is_journey) { |
71 if (!is_journey) { |
72 if (order->type != OT_GOTO_STATION) return_cmd_error(STR_TIMETABLE_ONLY_WAIT_AT_STATIONS); |
72 if (!order->IsType(OT_GOTO_STATION)) return_cmd_error(STR_TIMETABLE_ONLY_WAIT_AT_STATIONS); |
73 if (_patches.new_nonstop && (order->flags & OFB_NON_STOP)) return_cmd_error(STR_TIMETABLE_NOT_STOPPING_HERE); |
73 if (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) return_cmd_error(STR_TIMETABLE_NOT_STOPPING_HERE); |
74 } |
74 } |
75 |
75 |
76 if (flags & DC_EXEC) { |
76 if (flags & DC_EXEC) { |
77 ChangeTimetable(v, order_number, GB(p2, 0, 16), is_journey); |
77 ChangeTimetable(v, order_number, GB(p2, 0, 16), is_journey); |
78 if (packed_time) ChangeTimetable(v, order_number, GB(p2, 16, 16), false); |
78 if (packed_time) ChangeTimetable(v, order_number, GB(p2, 16, 16), false); |