diff options
author | glx <glx@openttd.org> | 2007-10-19 21:05:25 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-10-19 21:05:25 +0000 |
commit | c706b31eb782c40129a338a79b8e5a097eeefaf7 (patch) | |
tree | e47a41320e557f0ced0a1fe048f3df8ff8e4eed3 | |
parent | f3d79154eb20f7a77b67c51f078bc9e0b3ba0644 (diff) | |
download | openttd-c706b31eb782c40129a338a79b8e5a097eeefaf7.tar.xz |
(svn r11301) -Fix: water check when building industries didn't work
-rw-r--r-- | src/industry_cmd.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index bdd6fc6dc..7200e9e4e 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1228,24 +1228,15 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour; + /* Perform land/water check if not disabled */ + if (!HASBIT(its->slopes_refused, 5) && (IsWaterTile(cur_tile) == !(ind_behav & INDUSTRYBEH_BUILT_ONWATER))) return false; + if (HASBIT(its->callback_flags, CBM_INDT_SHAPE_CHECK)) { custom_shape = true; if (!PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index)) return false; } else { - if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) { - /* As soon as the tile is not water, bail out. - * But that does not mean the search is over. You have - * to make sure every tile of the industry will be only water*/ - if (!IsWaterTile(cur_tile)) return false; - } else { - Slope tileh; - - if (IsWaterTile(cur_tile)) return false; - - tileh = GetTileSlope(cur_tile, NULL); - - refused_slope |= IsSlopeRefused(tileh, its->slopes_refused); - } + Slope tileh = GetTileSlope(cur_tile, NULL); + refused_slope |= IsSlopeRefused(tileh, its->slopes_refused); } if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) { |