src/timetable_cmd.cpp
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6878 7d1ff2f621c7
child 10242 52b4a9006029
equal deleted inserted replaced
10179:eec5a7dcbf61 10184:fcf5fb2548eb
    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);