summaryrefslogtreecommitdiff
path: root/src/track_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-02 22:51:07 +0000
committerrubidium <rubidium@openttd.org>2008-08-02 22:51:07 +0000
commit8c7983727ee173866ae7e9c4d6a679e5cf31781e (patch)
treefb6425f4783058dfae1fd7d48f11b66496f4ac6f /src/track_func.h
parentabc46b1e866b2d079aac7db946213715302c6dfb (diff)
downloadopenttd-8c7983727ee173866ae7e9c4d6a679e5cf31781e.tar.xz
(svn r13941) -Codechange [YAPP]: Added YAPP-related penalties to YAPF. (michi_cc)
Diffstat (limited to 'src/track_func.h')
-rw-r--r--src/track_func.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/track_func.h b/src/track_func.h
index 144ea03e8..706de2067 100644
--- a/src/track_func.h
+++ b/src/track_func.h
@@ -590,6 +590,19 @@ static inline bool TracksOverlap(TrackBits bits)
}
/**
+ * Check if a given track is contained within or overlaps some other tracks.
+ *
+ * @param tracks Tracks to be testet against
+ * @param track The track to test
+ * @return true if the track is already in the tracks or overlaps the tracks.
+ */
+static inline bool TrackOverlapsTracks(TrackBits tracks, Track track)
+{
+ if (HasBit(tracks, track)) return true;
+ return TracksOverlap(tracks | TrackToTrackBits(track));
+}
+
+/**
* Checks whether the trackdir means that we are reversing.
* @param dir the trackdir to check
* @return true if it is a reversing road trackdir