1226 |
1226 |
1227 const IndustryTileSpec *its = GetIndustryTileSpec(gfx); |
1227 const IndustryTileSpec *its = GetIndustryTileSpec(gfx); |
1228 |
1228 |
1229 IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour; |
1229 IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour; |
1230 |
1230 |
|
1231 /* Perform land/water check if not disabled */ |
|
1232 if (!HASBIT(its->slopes_refused, 5) && (IsWaterTile(cur_tile) == !(ind_behav & INDUSTRYBEH_BUILT_ONWATER))) return false; |
|
1233 |
1231 if (HASBIT(its->callback_flags, CBM_INDT_SHAPE_CHECK)) { |
1234 if (HASBIT(its->callback_flags, CBM_INDT_SHAPE_CHECK)) { |
1232 custom_shape = true; |
1235 custom_shape = true; |
1233 if (!PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index)) return false; |
1236 if (!PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index)) return false; |
1234 } else { |
1237 } else { |
1235 if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) { |
1238 Slope tileh = GetTileSlope(cur_tile, NULL); |
1236 /* As soon as the tile is not water, bail out. |
1239 refused_slope |= IsSlopeRefused(tileh, its->slopes_refused); |
1237 * But that does not mean the search is over. You have |
|
1238 * to make sure every tile of the industry will be only water*/ |
|
1239 if (!IsWaterTile(cur_tile)) return false; |
|
1240 } else { |
|
1241 Slope tileh; |
|
1242 |
|
1243 if (IsWaterTile(cur_tile)) return false; |
|
1244 |
|
1245 tileh = GetTileSlope(cur_tile, NULL); |
|
1246 |
|
1247 refused_slope |= IsSlopeRefused(tileh, its->slopes_refused); |
|
1248 } |
|
1249 } |
1240 } |
1250 |
1241 |
1251 if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) { |
1242 if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) { |
1252 if (!IsTileType(cur_tile, MP_HOUSE)) { |
1243 if (!IsTileType(cur_tile, MP_HOUSE)) { |
1253 _error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS; |
1244 _error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS; |