summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_costrail.hpp
diff options
context:
space:
mode:
authorVít Šefl <vituscze@gmail.com>2021-05-15 17:23:23 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-23 20:19:39 +0200
commit33d99d27f4426e7d087b7ea3ed8e84d1059e1b76 (patch)
tree6f2a2f620d586d74f9f173247b16fbbd3d7c58ae /src/pathfinder/yapf/yapf_costrail.hpp
parent97722931a976dc3e6603611b8ec48f10920960e4 (diff)
downloadopenttd-33d99d27f4426e7d087b7ea3ed8e84d1059e1b76.tar.xz
Fix: Encountering two-way red signals could prune unrelated branches.
The intermediate node branch is now only pruned if the node is on the path leading to the two-way red signal.
Diffstat (limited to 'src/pathfinder/yapf/yapf_costrail.hpp')
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp
index b50300b61..908814c8c 100644
--- a/src/pathfinder/yapf/yapf_costrail.hpp
+++ b/src/pathfinder/yapf/yapf_costrail.hpp
@@ -199,7 +199,7 @@ public:
* was it first signal which is two-way? */
if (!IsPbsSignal(sig_type) && 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. Prune this branch... */
- Yapf().PruneIntermediateNodeBranch();
+ Yapf().PruneIntermediateNodeBranch(&n);
n.m_segment->m_end_segment_reason |= ESRB_DEAD_END;
Yapf().m_stopped_on_first_two_way_signal = true;
return -1;