Changeset - r16199:e5327cbb9669
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-10-08 21:08:38
rubidium@openttd.org
(svn r20909) -Fix [FS#4137]: don't see coasts as water for object construction
2 files changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/object_cmd.cpp
Show inline comments
 
@@ -166,7 +166,7 @@ CommandCost CmdBuildObject(TileIndex til
 
		bool allow_water = (spec->flags & (OBJECT_FLAG_BUILT_ON_WATER | OBJECT_FLAG_NOT_ON_LAND)) != 0;
 
		bool allow_ground = (spec->flags & OBJECT_FLAG_NOT_ON_LAND) == 0;
 
		TILE_AREA_LOOP(t, ta) {
 
			if (HasTileWaterClass(t) && IsTileOnWater(t)) {
 
			if (HasTileWaterClass(t) && IsTileOnWater(t) && !IsCoastTile(t)) {
 
				if (!allow_water) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 
				if (!IsWaterTile(t)) {
 
					/* Normal water tiles don't have to be cleared. For all other tile types clear
src/water_map.h
Show inline comments
 
@@ -171,6 +171,16 @@ static inline bool IsCoast(TileIndex t)
 
}
 

	
 
/**
 
 * Is it a coast tile
 
 * @param t Tile to query.
 
 * @return \c true if it is a coast.
 
 */
 
static inline bool IsCoastTile(TileIndex t)
 
{
 
	return IsTileType(t, MP_WATER) && IsCoast(t);
 
}
 

	
 
/**
 
 * Get the other tile of the ship depot.
 
 * @param t Tile to query, containing one section of a ship depot.
 
 * @return Tile containing the other section of the depot.
0 comments (0 inline, 0 general)