mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r21291) -Fix: Treat objects on water like water in more cases.
This commit is contained in:
parent
612516ff76
commit
55d604e60d
@ -2386,7 +2386,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
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;
|
||||
|
@ -1123,7 +1123,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t
|
||||
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;
|
||||
|
||||
@ -1172,7 +1172,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t
|
||||
}
|
||||
|
||||
/* Return if a water tile */
|
||||
if (IsWaterTile(tile)) return;
|
||||
if (HasTileWaterGround(tile)) return;
|
||||
|
||||
/* Make the roads look nicer */
|
||||
rcmd = CleanUpRoadBits(tile, rcmd);
|
||||
|
@ -525,7 +525,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
|
||||
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;
|
||||
@ -582,7 +582,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
|
||||
/* 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);
|
||||
|
Loading…
Reference in New Issue
Block a user