summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorYexo <Yexo@openttd.org>2009-01-21 02:31:55 +0000
committerYexo <Yexo@openttd.org>2009-01-21 02:31:55 +0000
commite3c69b7c4ebebba0aa85ef41ff6627705acb1db5 (patch)
tree272533ac91b7bc3ab16c3ee1a997e142f3170a2a /src/terraform_gui.cpp
parent470437df70d63b2c44ce34d408b6820cfa446aed (diff)
downloadopenttd-e3c69b7c4ebebba0aa85ef41ff6627705acb1db5.tar.xz
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp14
1 files changed, 8 insertions, 6 deletions
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;