From 0f4d9a8e4928c8bd647734599b3eb8ec5720320a Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 14 Jul 2008 21:01:49 +0000 Subject: (svn r13704) -Fix: make timetables work more sensible when used in conjunction with conditional orders, i.e. make it possibly to tell how long to travel to the next destination if you jump. --- src/timetable_cmd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/timetable_cmd.cpp') diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 49384b03d..98c13a609 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -69,8 +69,10 @@ CommandCost CmdChangeTimetable(TileIndex tile, uint32 flags, uint32 p1, uint32 p bool packed_time = HasBit(p1, 25); bool is_journey = HasBit(p1, 24) || packed_time; if (!is_journey) { - if (!order->IsType(OT_GOTO_STATION)) return_cmd_error(STR_TIMETABLE_ONLY_WAIT_AT_STATIONS); + if (!order->IsType(OT_GOTO_STATION) && !order->IsType(OT_CONDITIONAL)) return_cmd_error(STR_TIMETABLE_ONLY_WAIT_AT_STATIONS); if (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) return_cmd_error(STR_TIMETABLE_NOT_STOPPING_HERE); + } else { + if (order->IsType(OT_CONDITIONAL)) return CMD_ERROR; } if (flags & DC_EXEC) { @@ -175,7 +177,9 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) * adjusted later by people who aren't. */ time_taken = (((time_taken - 1) / DAY_TICKS) + 1) * DAY_TICKS; - ChangeTimetable(v, v->cur_order_index, time_taken, travelling); + if (!v->current_order.IsType(OT_CONDITIONAL)) { + ChangeTimetable(v, v->cur_order_index, time_taken, travelling); + } return; } else if (v->cur_order_index == 0) { /* Otherwise if we're at the beginning and it already has a value, -- cgit v1.2.3-54-g00ecf