summaryrefslogtreecommitdiff
path: root/src/water_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/water_map.h')
-rw-r--r--src/water_map.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/water_map.h b/src/water_map.h
index 41a903dd3..f768a7d78 100644
--- a/src/water_map.h
+++ b/src/water_map.h
@@ -284,6 +284,17 @@ static inline byte GetWaterTileRandomBits(TileIndex t)
return _m[t].m4;
}
+/**
+ * Checks whether the tile has water at the ground.
+ * That is, it is either some plain water tile, or a object/industry/station/... with water under it.
+ * @return true iff the tile has water at the ground.
+ * @note Coast tiles are not considered waterish, even if there is water on a halftile.
+ */
+static inline bool HasTileWaterGround(TileIndex t)
+{
+ return HasTileWaterClass(t) && IsTileOnWater(t) && !IsCoastTile(t);
+}
+
/**
* Helper function to make a coast tile.