Changeset - r15451:c94d3a674285
[Not reviewed]
master
0 1 0
alberth - 14 years ago 2010-07-10 13:04:31
alberth@openttd.org
(svn r20110) -Fix [FS#3695]: Do not allow building a rail track to the water using a tree-tile.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -320,25 +320,25 @@ Foundation GetRailFoundation(Slope tileh
 
/**
 
 * Tests if a track can be build on a tile.
 
 *
 
 * @param tileh Tile slope.
 
 * @param rail_bits Tracks to build.
 
 * @param existing Tracks already built.
 
 * @param tile Tile (used for water test)
 
 * @return Error message or cost for foundation building.
 
 */
 
static CommandCost CheckRailSlope(Slope tileh, TrackBits rail_bits, TrackBits existing, TileIndex tile)
 
{
 
	/* don't allow building on the lower side of a coast */
 
	if (IsTileType(tile, MP_WATER) || (IsTileType(tile, MP_RAILWAY) && (GetRailGroundType(tile) == RAIL_GROUND_WATER))) {
 
	if (GetFloodingBehaviour(tile) != FLOOD_NONE) {
 
		if (!IsSteepSlope(tileh) && ((~_valid_tracks_on_leveled_foundation[tileh] & (rail_bits | existing)) != 0)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 
	}
 

	
 
	Foundation f_new = GetRailFoundation(tileh, rail_bits | existing);
 

	
 
	/* check track/slope combination */
 
	if ((f_new == FOUNDATION_INVALID) ||
 
			((f_new != FOUNDATION_NONE) && (!_settings_game.construction.build_on_slopes))) {
 
		return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
 
	}
 

	
 
	Foundation f_old = GetRailFoundation(tileh, existing);
0 comments (0 inline, 0 general)