Scheduled dispatch: Add hints about dispatch order to timetable window

Adjust condition for dispatch order
This commit is contained in:
Jonathan G Rennison
2020-01-29 00:25:09 +00:00
parent 4c15e3dacc
commit 9917a1daef
6 changed files with 35 additions and 17 deletions

View File

@@ -33,8 +33,6 @@
#include "safeguards.h"
VehicleOrderID GetVehicleFirstWaitingLocation(const Vehicle *v);
/** Container for the arrival/departure dates of a vehicle */
struct TimetableArrivalDeparture {
Ticks arrival; ///< The arrival time
@@ -114,7 +112,7 @@ static void FillTimetableArrivalDepartureTable(const Vehicle *v, VehicleOrderID
}
VehicleOrderID scheduled_dispatch_order = INVALID_VEH_ORDER_ID;
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH)) scheduled_dispatch_order = GetVehicleFirstWaitingLocation(v);
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH)) scheduled_dispatch_order = v->GetFirstWaitingLocation(true);
/* Cyclically loop over all orders until we reach the current one again.
* As we may start at the current order, do a post-checking loop */
@@ -685,6 +683,14 @@ struct TimetableWindow : Window {
if (have_bad_full_load) draw_info(STR_TIMETABLE_WARNING_FULL_LOAD, true);
if (have_conditional && HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) draw_info(STR_TIMETABLE_WARNING_AUTOFILL_CONDITIONAL, true);
if (total_time && have_non_timetabled_conditional_branch) draw_info(STR_TIMETABLE_NON_TIMETABLED_BRANCH, false);
if (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH)) {
VehicleOrderID n = v->GetFirstWaitingLocation(false);
if (n == INVALID_VEH_ORDER_ID) {
draw_info(STR_TIMETABLE_WARNING_NO_SCHEDULED_DISPATCH_ORDER, true);
} else if (!v->GetOrder(n)->IsWaitTimetabled()) {
draw_info(STR_TIMETABLE_WARNING_SCHEDULED_DISPATCH_ORDER_NO_WAIT_TIME, true);
}
}
if (warning_count != this->summary_warnings) {
TimetableWindow *mutable_this = const_cast<TimetableWindow *>(this);