Changeset - r16553:97a5aaaa977f
[Not reviewed]
master
0 3 0
frosch - 14 years ago 2010-11-21 18:39:12
frosch@openttd.org
(svn r21291) -Fix: Treat objects on water like water in more cases.
3 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2383,13 +2383,13 @@ CommandCost CmdBuildDock(TileIndex tile,
 

	
 
	DiagDirection direction = GetInclinedSlopeDirection(GetTileSlope(tile, NULL));
 
	if (direction == INVALID_DIAGDIR) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
 
	direction = ReverseDiagDir(direction);
 

	
 
	/* Docks cannot be placed on rapids */
 
	if (IsWaterTile(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
 
	if (HasTileWaterGround(tile)) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
 

	
 
	CommandCost ret = CheckIfAuthorityAllowsNewStation(tile, flags);
 
	if (ret.Failed()) return ret;
 

	
 
	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 

	
src/town_cmd.cpp
Show inline comments
 
@@ -1120,13 +1120,13 @@ static void GrowTownInTile(TileIndex *ti
 
		if (cur_rb & DiagDirToRoadBits(target_dir)) return;
 

	
 
		/* This is the tile we will reach if we extend to this direction. */
 
		TileIndex house_tile = TileAddByDiagDir(tile, target_dir); // position of a possible house
 

	
 
		/* Don't walk into water. */
 
		if (IsWaterTile(house_tile)) return;
 
		if (HasTileWaterGround(house_tile)) return;
 

	
 
		if (!IsValidTile(house_tile)) return;
 

	
 
		if (_settings_game.economy.allow_town_roads || _generating_world) {
 
			switch (t1->layout) {
 
				default: NOT_REACHED();
 
@@ -1169,13 +1169,13 @@ static void GrowTownInTile(TileIndex *ti
 
		}
 

	
 
		_grow_town_result = GROWTH_SEARCH_STOPPED;
 
	}
 

	
 
	/* Return if a water tile */
 
	if (IsWaterTile(tile)) return;
 
	if (HasTileWaterGround(tile)) return;
 

	
 
	/* Make the roads look nicer */
 
	rcmd = CleanUpRoadBits(tile, rcmd);
 
	if (rcmd == ROAD_NONE) return;
 

	
 
	/* Only use the target direction for bridges to ensure they're connected.
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -522,13 +522,13 @@ CommandCost CmdBuildTunnel(TileIndex sta
 
	uint start_z;
 
	uint end_z;
 
	Slope start_tileh = GetTileSlope(start_tile, &start_z);
 
	DiagDirection direction = GetInclinedSlopeDirection(start_tileh);
 
	if (direction == INVALID_DIAGDIR) return_cmd_error(STR_ERROR_SITE_UNSUITABLE_FOR_TUNNEL);
 

	
 
	if (IsWaterTile(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 
	if (HasTileWaterGround(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 

	
 
	CommandCost ret = DoCommand(start_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
	if (ret.Failed()) return ret;
 

	
 
	/* XXX - do NOT change 'ret' in the loop, as it is used as the price
 
	 * for the clearing of the entrance of the tunnel. Assigning it to
 
@@ -579,13 +579,13 @@ CommandCost CmdBuildTunnel(TileIndex sta
 
	cost.AddCost(_price[PR_BUILD_TUNNEL]);
 
	cost.AddCost(ret);
 

	
 
	/* if the command fails from here on we want the end tile to be highlighted */
 
	_build_tunnel_endtile = end_tile;
 

	
 
	if (IsWaterTile(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 
	if (HasTileWaterGround(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 

	
 
	/* Clear the tile in any case */
 
	ret = DoCommand(end_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
	if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND);
 
	cost.AddCost(ret);
 

	
0 comments (0 inline, 0 general)