summaryrefslogtreecommitdiff
path: root/src/road_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/road_func.h')
-rw-r--r--src/road_func.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/road_func.h b/src/road_func.h
index 46269f29d..c0baeee3f 100644
--- a/src/road_func.h
+++ b/src/road_func.h
@@ -101,6 +101,17 @@ static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
}
/**
+ * Check if we've got a straight road
+ *
+ * @param r The given RoadBits
+ * @return true if we've got a straight road
+ */
+static inline bool IsStraightRoad(RoadBits r)
+{
+ return (r == ROAD_X || r == ROAD_Y);
+}
+
+/**
* Create the road-part which belongs to the given DiagDirection
*
* This function returns a RoadBits value which belongs to