diff options
author | rubidium <rubidium@openttd.org> | 2008-08-02 22:49:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-02 22:49:10 +0000 |
commit | d5def69d870a10d94e6801991077d86c3fb5c52f (patch) | |
tree | ee6f5139f01ac19eca3cf90b3651b1ea8931f4a3 | |
parent | c34a1db15e56b33c7c05b8bd4a2d783256c4cee0 (diff) | |
download | openttd-d5def69d870a10d94e6801991077d86c3fb5c52f.tar.xz |
(svn r13934) -Codechange [YAPP]: Handle through signals in the pathfinders. (michi_cc)
-rw-r--r-- | src/npf.cpp | 6 | ||||
-rw-r--r-- | src/pathfind.cpp | 2 | ||||
-rw-r--r-- | src/yapf/yapf_costrail.hpp | 2 |
3 files changed, 5 insertions, 5 deletions
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) { |