Departures: Only do smart terminus detection for station departures

This commit is contained in:
Jonathan G Rennison 2024-09-09 17:45:20 +01:00
parent e964e1a9d3
commit db9e2e545c
3 changed files with 9 additions and 2 deletions

View File

@ -1093,7 +1093,7 @@ static DepartureList MakeDepartureListLiveMode(DepartureOrderDestinationDetector
if (type == D_DEPARTURE) { if (type == D_DEPARTURE) {
ScheduledDispatchDepartureLocalFix(result); ScheduledDispatchDepartureLocalFix(result);
if (_settings_client.gui.departure_smart_terminus) { if (calling_settings.SmartTerminusEnabled()) {
ScheduledDispatchSmartTerminusDetection(result); ScheduledDispatchSmartTerminusDetection(result);
} }
} }
@ -1511,7 +1511,7 @@ static DepartureList MakeDepartureListScheduleMode(DepartureOrderDestinationDete
return a->scheduled_tick < b->scheduled_tick; return a->scheduled_tick < b->scheduled_tick;
}); });
if (type == D_DEPARTURE && _settings_client.gui.departure_smart_terminus) { if (type == D_DEPARTURE && calling_settings.SmartTerminusEnabled()) {
ScheduledDispatchSmartTerminusDetection(result, tick_duration); ScheduledDispatchSmartTerminusDetection(result, tick_duration);
} }

View File

@ -612,6 +612,7 @@ public:
settings.SetDepartureNoLoadTest((this->source_type == DST_WAYPOINT) || _settings_client.gui.departure_show_all_stops); settings.SetDepartureNoLoadTest((this->source_type == DST_WAYPOINT) || _settings_client.gui.departure_show_all_stops);
settings.SetShowAllStops(_settings_client.gui.departure_show_all_stops); settings.SetShowAllStops(_settings_client.gui.departure_show_all_stops);
settings.SetCargoFilter(show_pax, show_freight); settings.SetCargoFilter(show_pax, show_freight);
settings.SetSmartTerminusEnabled(_settings_client.gui.departure_smart_terminus && (this->source_type == DST_STATION));
if (this->mode != DM_ARRIVALS) { if (this->mode != DM_ARRIVALS) {
this->departures = MakeDepartureList(this->source_mode, list_source, this->vehicles, D_DEPARTURE, settings); this->departures = MakeDepartureList(this->source_mode, list_source, this->vehicles, D_DEPARTURE, settings);

View File

@ -148,6 +148,7 @@ private:
ShowAllStops, ShowAllStops,
ShowPax, ShowPax,
ShowFreight, ShowFreight,
SmartTerminusEnabled,
}; };
}; };
@ -158,6 +159,7 @@ public:
inline bool ShowAllStops() const { return HasBit(this->flags, FlagBits::ShowAllStops); } inline bool ShowAllStops() const { return HasBit(this->flags, FlagBits::ShowAllStops); }
inline bool ShowPax() const { return HasBit(this->flags, FlagBits::ShowPax); } inline bool ShowPax() const { return HasBit(this->flags, FlagBits::ShowPax); }
inline bool ShowFreight() const { return HasBit(this->flags, FlagBits::ShowFreight); } inline bool ShowFreight() const { return HasBit(this->flags, FlagBits::ShowFreight); }
inline bool SmartTerminusEnabled() const { return HasBit(this->flags, FlagBits::SmartTerminusEnabled); }
inline void SetViaMode(bool allow_via, bool check_show_as_via_type) inline void SetViaMode(bool allow_via, bool check_show_as_via_type)
{ {
@ -177,6 +179,10 @@ public:
AssignBit(this->flags, FlagBits::ShowPax, pax); AssignBit(this->flags, FlagBits::ShowPax, pax);
AssignBit(this->flags, FlagBits::ShowFreight, freight); AssignBit(this->flags, FlagBits::ShowFreight, freight);
} }
inline void SetSmartTerminusEnabled(bool enabled)
{
AssignBit(this->flags, FlagBits::SmartTerminusEnabled, enabled);
}
bool IsDeparture(const Order *order, const DepartureOrderDestinationDetector &source) const; bool IsDeparture(const Order *order, const DepartureOrderDestinationDetector &source) const;
bool IsArrival(const Order *order, const DepartureOrderDestinationDetector &source) const; bool IsArrival(const Order *order, const DepartureOrderDestinationDetector &source) const;