diff options
author | KUDr <kudr@openttd.org> | 2006-12-29 23:06:00 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-12-29 23:06:00 +0000 |
commit | af2a4cecde8aeae4af2cc22b81a41b206fa9bca0 (patch) | |
tree | ff0fd7297f60c73185643991a81b7e71a056e253 /yapf/yapf_costrail.hpp | |
parent | 4cee3f0b068d73197e396ed8c29448c70ee26272 (diff) | |
download | openttd-af2a4cecde8aeae4af2cc22b81a41b206fa9bca0.tar.xz |
(svn r7628) -Fix: [YAPF] suppress 'Train is lost' message if pathfinding ended on the first two-way red signal due to yapf.rail_firstred_twoway_eol option.
Diffstat (limited to 'yapf/yapf_costrail.hpp')
-rw-r--r-- | yapf/yapf_costrail.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/yapf/yapf_costrail.hpp b/yapf/yapf_costrail.hpp index c8e34dfbd..93062b5c2 100644 --- a/yapf/yapf_costrail.hpp +++ b/yapf/yapf_costrail.hpp @@ -19,10 +19,15 @@ public: protected: int m_max_cost; CBlobT<int> m_sig_look_ahead_costs; +public: + bool m_stopped_on_first_two_way_signal; +protected: static const int s_max_segment_cost = 10000; - CYapfCostRailT() : m_max_cost(0) + CYapfCostRailT() + : m_max_cost(0) + , m_stopped_on_first_two_way_signal(false) { // pre-compute look-ahead penalties into array int p0 = Yapf().PfGetSettings().rail_look_ahead_signal_p0; @@ -116,6 +121,7 @@ public: if (Yapf().TreatFirstRedTwoWaySignalAsEOL() && n.flags_u.flags_s.m_choice_seen && has_signal_against && n.m_num_signals_passed == 0) { // yes, the first signal is two-way red signal => DEAD END n.m_segment->flags_u.flags_s.m_end_of_line = true; + Yapf().m_stopped_on_first_two_way_signal = true; return -1; } SignalType sig_type = GetSignalType(tile); |