src/industry_map.h
changeset 9718 4b7468076d31
parent 8119 52b48108425a
child 9838 976f08497fa7
--- a/src/industry_map.h	Sat Jul 26 14:58:08 2008 +0000
+++ b/src/industry_map.h	Sat Jul 26 16:14:10 2008 +0000
@@ -7,7 +7,7 @@
 
 #include "industry.h"
 #include "tile_map.h"
-
+#include "water_map.h"
 
 
 /**
@@ -155,13 +155,24 @@
 }
 
 /**
+ * Tests if the industry tile was built on water.
+ * @param t the industry tile
+ * @return true iff on water
+ */
+static inline bool IsIndustryTileOnWater(TileIndex t)
+{
+	assert(IsTileType(t, MP_INDUSTRY));
+	return (GetWaterClass(t) != WATER_CLASS_INVALID);
+}
+
+/**
  * Make the given tile an industry tile
  * @param t      the tile to make an industry tile
  * @param index  the industry this tile belongs to
  * @param gfx    the graphics to use for the tile
  * @param random the random value
  */
-static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random)
+static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc)
 {
 	SetTileType(t, MP_INDUSTRY);
 	_m[t].m1 = 0;
@@ -170,6 +181,7 @@
 	_m[t].m4 = 0;
 	SetIndustryGfx(t, gfx);
 	_me[t].m7 = random;
+	SetWaterClass(t, wc);
 }
 
 /**