Scheduled dispatch: Do not show required vehicles if conditional order present
This commit is contained in:
@@ -349,11 +349,20 @@ struct SchdispatchWindow : Window {
|
|||||||
this->last_departure_future ? STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_FUTURE : STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_PAST);
|
this->last_departure_future ? STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_FUTURE : STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_PAST);
|
||||||
y += FONT_HEIGHT_NORMAL;
|
y += FONT_HEIGHT_NORMAL;
|
||||||
|
|
||||||
|
bool have_conditional = false;
|
||||||
|
for (int n = 0; n < v->GetNumOrders(); n++) {
|
||||||
|
const Order *order = v->GetOrder(n);
|
||||||
|
if (order->IsType(OT_CONDITIONAL)) {
|
||||||
|
have_conditional = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!have_conditional) {
|
||||||
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders.list->GetTimetableTotalDuration(), v->orders.list->GetScheduledDispatchDuration(), v->orders.list->GetScheduledDispatch());
|
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders.list->GetTimetableTotalDuration(), v->orders.list->GetScheduledDispatchDuration(), v->orders.list->GetScheduledDispatch());
|
||||||
if (required_vehicle > 0) {
|
if (required_vehicle > 0) {
|
||||||
SetDParam(0, required_vehicle);
|
SetDParam(0, required_vehicle);
|
||||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_SCHDISPATCH_SUMMARY_L1);
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_SCHDISPATCH_SUMMARY_L1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
y += FONT_HEIGHT_NORMAL;
|
y += FONT_HEIGHT_NORMAL;
|
||||||
|
|
||||||
SetTimetableParams(0, v->orders.list->GetScheduledDispatchDuration());
|
SetTimetableParams(0, v->orders.list->GetScheduledDispatchDuration());
|
||||||
|
Reference in New Issue
Block a user