mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Departures: Only do smart terminus detection for station departures
This commit is contained in:
parent
e964e1a9d3
commit
db9e2e545c
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user