153 _m[t].m5 = GB(gfx, 0, 8); |
153 _m[t].m5 = GB(gfx, 0, 8); |
154 SB(_m[t].m6, 2, 1, GB(gfx, 8, 1)); |
154 SB(_m[t].m6, 2, 1, GB(gfx, 8, 1)); |
155 } |
155 } |
156 |
156 |
157 /** |
157 /** |
|
158 * Tests if the industry tile was built on water. |
|
159 * @param t the industry tile |
|
160 * @return true iff on water |
|
161 */ |
|
162 static inline bool IsIndustryTileOnWater(TileIndex t) |
|
163 { |
|
164 assert(IsTileType(t, MP_INDUSTRY)); |
|
165 return (GetWaterClass(t) != WATER_CLASS_INVALID); |
|
166 } |
|
167 |
|
168 /** |
158 * Make the given tile an industry tile |
169 * Make the given tile an industry tile |
159 * @param t the tile to make an industry tile |
170 * @param t the tile to make an industry tile |
160 * @param index the industry this tile belongs to |
171 * @param index the industry this tile belongs to |
161 * @param gfx the graphics to use for the tile |
172 * @param gfx the graphics to use for the tile |
162 * @param random the random value |
173 * @param random the random value |
163 */ |
174 */ |
164 static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random) |
175 static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc) |
165 { |
176 { |
166 SetTileType(t, MP_INDUSTRY); |
177 SetTileType(t, MP_INDUSTRY); |
167 _m[t].m1 = 0; |
178 _m[t].m1 = 0; |
168 _m[t].m2 = index; |
179 _m[t].m2 = index; |
169 _m[t].m3 = 0; |
180 _m[t].m3 = 0; |
170 _m[t].m4 = 0; |
181 _m[t].m4 = 0; |
171 SetIndustryGfx(t, gfx); |
182 SetIndustryGfx(t, gfx); |
172 _me[t].m7 = random; |
183 _me[t].m7 = random; |
|
184 SetWaterClass(t, wc); |
173 } |
185 } |
174 |
186 |
175 /** |
187 /** |
176 * Returns this indutry tile's construction counter value |
188 * Returns this indutry tile's construction counter value |
177 * @param tile the tile to query |
189 * @param tile the tile to query |