diff options
-rw-r--r-- | src/timetable_gui.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 2962f47b0..348bd0f0d 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -248,17 +248,10 @@ struct TimetableWindow : Window { case TTV_SUMMARY_PANEL: { int y = r.top + WD_FRAMERECT_TOP; - uint total_time = 0; - bool complete = true; - for (const Order *order = v->GetOrder(0); order != NULL; order = order->next) { - total_time += order->travel_time + order->wait_time; - if (order->travel_time == 0 && !order->IsType(OT_CONDITIONAL)) complete = false; - if (order->wait_time == 0 && order->IsType(OT_GOTO_STATION) && !(order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) complete = false; - } - + Ticks total_time = v->orders.list != NULL ? v->orders.list->GetTimetableDurationIncomplete() : 0; if (total_time != 0) { SetTimetableParams(0, 1, total_time); - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, complete ? STR_TIMETABLE_TOTAL_TIME : STR_TIMETABLE_TOTAL_TIME_INCOMPLETE); + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, v->orders.list->IsCompleteTimetable() ? STR_TIMETABLE_TOTAL_TIME : STR_TIMETABLE_TOTAL_TIME_INCOMPLETE); } y += FONT_HEIGHT_NORMAL; |