Changeset - r8383:3e97f6061bcc
[Not reviewed]
master
0 2 0
peter1138 - 16 years ago 2008-01-22 22:17:28
peter1138@openttd.org
(svn r11952) -Fix (r11926): Prevent industries from being built on rivers, unless they require water.
2 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1223,13 +1223,13 @@ static bool CheckIfIndustryTilesAreFree(
 

	
 
			const IndustryTileSpec *its = GetIndustryTileSpec(gfx);
 

	
 
			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;
 
				if (!PerformIndustryTileSlopeCheck(tile, cur_tile, its, type, gfx, itspec_index)) return false;
 
			} else {
 
				Slope tileh = GetTileSlope(cur_tile, NULL);
src/water_map.h
Show inline comments
 
@@ -69,12 +69,17 @@ static inline bool IsRiver(TileIndex t)
 

	
 
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));
 
}
 

	
 
static inline TileIndex IsShipDepot(TileIndex t)
0 comments (0 inline, 0 general)