From db3ee34b4468aa3448b64e339258760885c5d716 Mon Sep 17 00:00:00 2001 From: Yexo Date: Wed, 21 Jan 2009 02:31:55 +0000 Subject: (svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map. --- src/terraform_gui.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/terraform_gui.cpp') diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index b0aa2e11a..5a9a1cf40 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -113,10 +113,12 @@ static void GenerateRockyArea(TileIndex end, TileIndex start) **/ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile) { - /* When end_tile is MP_VOID, the DoCommandP checks will deny this command without any - * user-visible reason. This happens when terraforming at the southern border. */ - if (TileX(end_tile) == MapMaxX()) end_tile += TileDiffXY(-1, 0); - if (TileY(end_tile) == MapMaxY()) end_tile += TileDiffXY(0, -1); + if (!_settings_game.construction.freeform_edges) { + /* When end_tile is MP_VOID, the error tile will not be visible to the + * user. This happens when terraforming at the southern border. */ + if (TileX(end_tile) == MapMaxX()) end_tile += TileDiffXY(-1, 0); + if (TileY(end_tile) == MapMaxY()) end_tile += TileDiffXY(0, -1); + } switch (proc) { case DDSP_DEMOLISH_AREA: @@ -378,8 +380,8 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) } else { assert(_terraform_size != 0); /* check out for map overflows */ - sizex = min(MapSizeX() - TileX(tile) - 1, _terraform_size); - sizey = min(MapSizeY() - TileY(tile) - 1, _terraform_size); + sizex = min(MapSizeX() - TileX(tile), _terraform_size); + sizey = min(MapSizeY() - TileY(tile), _terraform_size); if (sizex == 0 || sizey == 0) return; -- cgit v1.2.3-54-g00ecf