summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-14 13:11:39 +0000
committersmatz <smatz@openttd.org>2009-01-14 13:11:39 +0000
commit9d6a7127f68c5ef3bcae29a52dfdc951986f4b60 (patch)
treeefe2d6c3ad4afc746be07f335c8dc60b7eadec8b /src/terraform_gui.cpp
parent850a2735cc2f3806703a1f107c9f73533d750e7c (diff)
downloadopenttd-9d6a7127f68c5ef3bcae29a52dfdc951986f4b60.tar.xz
(svn r15080) -Fix: terraforming at the northern border failed without any visible reason
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 296339ce6..dd44a0e44 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -113,6 +113,11 @@ 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 northern 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:
DoCommandP(end_tile, start_tile, 0, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA), CcPlaySound10);