diff options
author | frosch <frosch@openttd.org> | 2008-07-26 16:14:10 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-07-26 16:14:10 +0000 |
commit | 16c80d031c49988143fec34af598685bb8bcefd1 (patch) | |
tree | 3a62ec9adb234e8726387b1573747436f7d43e9f /src/industry_map.h | |
parent | ea7ed286a63fdade4f1b55738a9d0fb110c00c01 (diff) | |
download | openttd-16c80d031c49988143fec34af598685bb8bcefd1.tar.xz |
(svn r13838) -Codechange: Make industry tiles aware of WaterClasses.
Diffstat (limited to 'src/industry_map.h')
-rw-r--r-- | src/industry_map.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/industry_map.h b/src/industry_map.h index 77cab8920..04be3513a 100644 --- a/src/industry_map.h +++ b/src/industry_map.h @@ -7,7 +7,7 @@ #include "industry.h" #include "tile_map.h" - +#include "water_map.h" /** @@ -155,13 +155,24 @@ static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx) } /** + * 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 @@ static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, _m[t].m4 = 0; SetIndustryGfx(t, gfx); _me[t].m7 = random; + SetWaterClass(t, wc); } /** |