From 5c55922a0637547548b8286cdaf0e8645478fc46 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 2 Aug 2008 22:49:10 +0000 Subject: (svn r13934) -Codechange [YAPP]: Handle through signals in the pathfinders. (michi_cc) --- src/npf.cpp | 6 +++--- src/pathfind.cpp | 2 +- src/yapf/yapf_costrail.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/npf.cpp b/src/npf.cpp index e4498bbea..478b62b61 100644 --- a/src/npf.cpp +++ b/src/npf.cpp @@ -719,10 +719,10 @@ static void NPFFollowTrack(AyStar* aystar, OpenListNode* current) Trackdir dst_trackdir = RemoveFirstTrackdir(&trackdirbits); DEBUG(npf, 5, "Expanded into trackdir: %d, remaining trackdirs: 0x%X", dst_trackdir, trackdirbits); - /* Check for oneway signal against us */ + /* Tile with signals? */ if (IsTileType(dst_tile, MP_RAILWAY) && GetRailTileType(dst_tile) == RAIL_TILE_SIGNALS) { - if (HasSignalOnTrackdir(dst_tile, ReverseTrackdir(dst_trackdir)) && !HasSignalOnTrackdir(dst_tile, dst_trackdir)) - /* if one way signal not pointing towards us, stop going in this direction. */ + if (HasSignalOnTrackdir(dst_tile, ReverseTrackdir(dst_trackdir)) && !HasSignalOnTrackdir(dst_tile, dst_trackdir) && IsOnewaySignal(dst_tile, TrackdirToTrack(dst_trackdir))) + /* If there's a one-way signal not pointing towards us, stop going in this direction. */ break; } { diff --git a/src/pathfind.cpp b/src/pathfind.cpp index 9757b09af..e6a27df72 100644 --- a/src/pathfind.cpp +++ b/src/pathfind.cpp @@ -674,7 +674,7 @@ start_at: if (HasSignals(tile)) { if (!HasSignalOnTrackdir(tile, track)) { /* if one way signal not pointing towards us, stop going in this direction => End of rail segment. */ - if (HasSignalOnTrackdir(tile, ReverseTrackdir(track))) { + if (HasSignalOnTrackdir(tile, ReverseTrackdir(track)) && IsOnewaySignal(tile, TrackdirToTrack(track))) { bits = TRACK_BIT_NONE; break; } diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp index abd421068..ddfdca644 100644 --- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -136,7 +136,7 @@ public: if (IsTileType(tile, MP_RAILWAY)) { bool has_signal_against = HasSignalOnTrackdir(tile, ReverseTrackdir(trackdir)); bool has_signal_along = HasSignalOnTrackdir(tile, trackdir); - if (has_signal_against && !has_signal_along) { + if (has_signal_against && !has_signal_along && IsOnewaySignal(tile, TrackdirToTrack(trackdir))) { // one-way signal in opposite direction n.m_segment->m_end_segment_reason |= ESRB_DEAD_END; } else if (has_signal_along) { -- cgit v1.2.3-70-g09d2