summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-02 22:49:10 +0000
committerrubidium <rubidium@openttd.org>2008-08-02 22:49:10 +0000
commit5c55922a0637547548b8286cdaf0e8645478fc46 (patch)
treeee6f5139f01ac19eca3cf90b3651b1ea8931f4a3
parentd6645818b4b29a42dd617c92e23a525fe5170b6a (diff)
downloadopenttd-5c55922a0637547548b8286cdaf0e8645478fc46.tar.xz
(svn r13934) -Codechange [YAPP]: Handle through signals in the pathfinders. (michi_cc)
-rw-r--r--src/npf.cpp6
-rw-r--r--src/pathfind.cpp2
-rw-r--r--src/yapf/yapf_costrail.hpp2
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) {