summaryrefslogtreecommitdiff
path: root/src/terraform_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/terraform_cmd.cpp')
-rw-r--r--src/terraform_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index 8c0c63ac0..42e76ab46 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -10,6 +10,7 @@
/** @file terraform_cmd.cpp Commands related to terraforming. */
#include "stdafx.h"
+#include "layer_func.h"
#include "command_func.h"
#include "tunnel_map.h"
#include "bridge_map.h"
@@ -308,6 +309,10 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
if (z_N > z_min) tileh |= SLOPE_N;
if (pass == 0) {
+ /* Terrafrom enable only top layer */
+ if (IsUnderground(tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_TERRAFORM);
+ }
/* Check if bridge would take damage */
if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) &&
GetBridgeHeight(GetSouthernBridgeEnd(tile)) <= z_max) {