changeset 3530:9df1570ef580 draft

(svn r4386) -Codechange: Add and make use of IsCustomWaypoint
author celestar <celestar@openttd.org>
date Wed, 12 Apr 2006 13:25:32 +0000
parents 1f30f60f6a67
children fe1b9d85a226
files rail_cmd.c rail_map.h
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1308,7 +1308,7 @@
 
 		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);
--- a/rail_map.h
+++ b/rail_map.h
@@ -144,6 +144,11 @@
 	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;