summaryrefslogtreecommitdiff
path: root/src/water_map.h
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-19 13:44:41 +0000
committeryexo <yexo@openttd.org>2010-08-19 13:44:41 +0000
commit85740a02832c9c474833f929b4464eba06be66d3 (patch)
tree9e10d3039ec55bce24ceebffd0c4c949be1f45ee /src/water_map.h
parent16be24e13acf17a3292b490196d301b5b1aa1056 (diff)
downloadopenttd-85740a02832c9c474833f929b4464eba06be66d3.tar.xz
(svn r20559) -Fix [FS#4045]: make sure that all vehicles are build in the most northern depot/hangar tile
Diffstat (limited to 'src/water_map.h')
-rw-r--r--src/water_map.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/water_map.h b/src/water_map.h
index 55e2730a5..83c3a055f 100644
--- a/src/water_map.h
+++ b/src/water_map.h
@@ -198,6 +198,19 @@ static inline DiagDirection GetShipDepotDirection(TileIndex t)
}
/**
+ * Get the most northern tile of a ship depot.
+ * @param tile One of the tiles of the ship depot.
+ * @return The northern tile of the depot.
+ */
+static TileIndex GetShipDepotNorthTile(TileIndex t)
+{
+ assert(IsShipDepot(t));
+ TileIndex tile2 = GetOtherShipDepotTile(t);
+
+ return t < tile2 ? t : tile2;
+}
+
+/**
* Is it a water lock tile?
* @param t Water tile to query.
* @return \c true if it is a water lock tile.