diff options
-rw-r--r-- | src/industry_cmd.cpp | 2 | ||||
-rw-r--r-- | src/water_map.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 6d7eda55c..967c1d385 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1226,7 +1226,7 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable IndustryBehaviour 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->slopes_refused, 5) && ((IsWaterTile(cur_tile) || IsRiverTile(cur_tile)) == !(ind_behav & INDUSTRYBEH_BUILT_ONWATER))) return false; if (HasBit(its->callback_flags, CBM_INDT_SHAPE_CHECK)) { custom_shape = true; diff --git a/src/water_map.h b/src/water_map.h index 93ec67a9d..d7d0b0ba8 100644 --- a/src/water_map.h +++ b/src/water_map.h @@ -72,6 +72,11 @@ static inline bool IsWaterTile(TileIndex t) return IsTileType(t, MP_WATER) && IsWater(t); } +static inline bool IsRiverTile(TileIndex t) +{ + return IsTileType(t, MP_WATER) && IsRiver(t); +} + static inline TileIndex GetOtherShipDepotTile(TileIndex t) { return t + (HasBit(_m[t].m5, 0) ? -1 : 1) * (HasBit(_m[t].m5, 1) ? TileDiffXY(0, 1) : TileDiffXY(1, 0)); |