mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r14428) -Fix [FS#2306]: A 90-degree curve can be a safe waiting position if they are forbidden for trains.
This commit is contained in:
parent
c9a82ac3e7
commit
ba5575e0fc
@ -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. */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user