summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-12 13:25:32 +0000
committercelestar <celestar@openttd.org>2006-04-12 13:25:32 +0000
commitb03bd97b4786649535ed22de113ebe79d20e7874 (patch)
tree53e7fe870644b0543687ff65ae366360f6d8dc78
parent5d949514966a75672cb0ec23f24567d262183cae (diff)
downloadopenttd-b03bd97b4786649535ed22de113ebe79d20e7874.tar.xz
(svn r4386) -Codechange: Add and make use of IsCustomWaypoint
-rw-r--r--rail_cmd.c2
-rw-r--r--rail_map.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index 0f8c26406..1c0aee337 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1308,7 +1308,7 @@ static void DrawTile_Track(TileInfo *ti)
if (ti->tileh != 0) DrawFoundation(ti, ti->tileh);
- if (IsRailWaypoint(ti->tile) && HASBIT(_m[ti->tile].m3, 4)) {
+ if (IsRailWaypoint(ti->tile) && IsCustomWaypoint(ti->tile)) {
// look for customization
byte stat_id = GetWaypointByTile(ti->tile)->stat_id;
const StationSpec *stat = GetCustomStation(STAT_CLASS_WAYP, stat_id);
diff --git a/rail_map.h b/rail_map.h
index 08f6e5db3..2b09faf45 100644
--- a/rail_map.h
+++ b/rail_map.h
@@ -144,6 +144,11 @@ static inline void ClearCustomWaypointSprite(TileIndex t)
CLRBIT(_m[t].m3, 4);
}
+static inline bool IsCustomWaypoint(TileIndex t)
+{
+ return HASBIT(_m[t].m3, 4);
+}
+
static inline Axis GetWaypointAxis(TileIndex t)
{
return HASBIT(_m[t].m5, 0) ? AXIS_Y : AXIS_X;