station.h
changeset 1751 954dd2900ac9
parent 1742 ac65066ebfeb
child 1768 997fd3ae1384
--- a/station.h	Mon May 02 21:56:01 2005 +0000
+++ b/station.h	Mon May 02 22:13:20 2005 +0000
@@ -103,6 +103,8 @@
 	HVOT_TRUCK = 1 << 3,
 	HVOT_AIRCRAFT = 1 << 4,
 	HVOT_SHIP = 1 << 5,
+	/* This bit is used to mark stations. No, it does not belong here, but what
+	 * can we do? ;-) */
 	HVOT_BUOY = 1 << 6
 };
 
@@ -290,7 +292,7 @@
 		(_map5[tile] & 0x01) == (_map5[ref] & 0x01); // same direction?
 }
 
-static inline bool IsRoadStationTile(uint tile) {
+static inline bool IsRoadStationTile(TileIndex tile) {
 	return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0x43, 0x4B);
 }
 
@@ -302,6 +304,15 @@
 	return st->xy != 0; /* XXX: Replace by INVALID_TILE someday */
 }
 
+static inline bool IsBuoy(const Station* st)
+{
+	return st->had_vehicle_of_type & HVOT_BUOY; /* XXX: We should really ditch this ugly coding and switch to something sane... */
+}
+
+static inline bool IsBuoyTile(TileIndex tile) {
+	return IsTileType(tile, MP_STATION) && _map5[tile] == 0x52;
+}
+
 /* Get's the direction the station exit points towards. Ie, returns 0 for a
  * station with the exit NE. */
 static inline byte GetRoadStationDir(uint tile) {