From ba5575e0fc5d3b1314def4e9121a6b92207455ce Mon Sep 17 00:00:00 2001 From: michi_cc Date: Wed, 1 Oct 2008 15:48:44 +0000 Subject: [PATCH] (svn r14428) -Fix [FS#2306]: A 90-degree curve can be a safe waiting position if they are forbidden for trains. --- src/pbs.cpp | 2 +- src/yapf/yapf_costrail.hpp | 4 ++-- src/yapf/yapf_destrail.hpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pbs.cpp b/src/pbs.cpp index c57eba6155..711bbaaa0f 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -329,8 +329,8 @@ bool IsSafeWaitingPosition(const Vehicle *v, TileIndex tile, Trackdir trackdir, /* Check for reachable tracks. */ ft.m_new_td_bits &= DiagdirReachesTrackdirs(ft.m_exitdir); - if (ft.m_new_td_bits == TRACKDIR_BIT_NONE) return include_line_end; if (forbid_90deg) ft.m_new_td_bits &= ~TrackdirCrossesTrackdirs(trackdir); + if (ft.m_new_td_bits == TRACKDIR_BIT_NONE) return include_line_end; if (ft.m_new_td_bits != TRACKDIR_BIT_NONE && KillFirstBit(ft.m_new_td_bits) == TRACKDIR_BIT_NONE) { /* PBS signal on next trackdir? Safe position. */ diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp index 8259f4bb9e..e7e301d93d 100644 --- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -437,8 +437,8 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th end_segment_reason |= ESRB_DEAD_END; } - if (TrackFollower::DoTrackMasking() && tf_local.m_err != TrackFollower::EC_90DEG) { - if (!HasOnewaySignalBlockingTrackdir(cur.tile, cur.td)) end_segment_reason |= ESRB_SAFE_TILE; + if (TrackFollower::DoTrackMasking() && !HasOnewaySignalBlockingTrackdir(cur.tile, cur.td)) { + end_segment_reason |= ESRB_SAFE_TILE; } break; } diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp index da5d82a5c4..503b7f5309 100644 --- a/src/yapf/yapf_destrail.hpp +++ b/src/yapf/yapf_destrail.hpp @@ -85,8 +85,8 @@ public: FORCEINLINE bool PfDetectDestination(TileIndex tile, Trackdir td) { return - IsSafeWaitingPosition(Yapf().GetVehicle(), tile, td, true, TrackFollower::Allow90degTurns()) && - IsWaitingPositionFree(Yapf().GetVehicle(), tile, td, TrackFollower::Allow90degTurns()); + IsSafeWaitingPosition(Yapf().GetVehicle(), tile, td, true, !TrackFollower::Allow90degTurns()) && + IsWaitingPositionFree(Yapf().GetVehicle(), tile, td, !TrackFollower::Allow90degTurns()); } /** Called by YAPF to calculate cost estimate. Calculates distance to the destination