summaryrefslogtreecommitdiff
path: root/station_map.h
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-03-31 19:10:54 +0000
committercelestar <celestar@openttd.org>2006-03-31 19:10:54 +0000
commit446493149c637ea2517be5c17f86047911130489 (patch)
treeb1afcd4a3ffa7895ccd33c4d034fb543b8d4765f /station_map.h
parent1f88ea4ec64f7dc8153dff3a8ca0ce20e7789a68 (diff)
downloadopenttd-446493149c637ea2517be5c17f86047911130489.tar.xz
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
Diffstat (limited to 'station_map.h')
-rw-r--r--station_map.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/station_map.h b/station_map.h
index 1da92a0d9..e0ed3def0 100644
--- a/station_map.h
+++ b/station_map.h
@@ -105,6 +105,20 @@ static inline bool IsRoadStop(TileIndex t)
return IsTruckStop(t) || IsBusStop(t);
}
+static inline bool IsRoadStopTile(TileIndex t)
+{
+ return IsTileType(t, MP_STATION) && IsRoadStop(t);
+}
+
+/**
+ * Gets the direction the road stop entrance points towards.
+ */
+static inline DiagDirection GetRoadStopDir(TileIndex tile)
+{
+ assert(IsRoadStopTile(tile));
+ return (_m[tile].m5 - TRUCK_BASE) & 3;
+}
+
static inline bool IsOilRig(TileIndex t)
{
assert(IsTileType(t, MP_STATION));