(svn r13934) -Codechange [YAPP]: Handle through signals in the pathfinders. (michi_cc)

This commit is contained in:
rubidium 2008-08-02 22:49:10 +00:00
parent d6645818b4
commit 5c55922a06
3 changed files with 5 additions and 5 deletions

View File

@ -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;
}
{

View File

@ -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;
}

View File

@ -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) {