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 aad982282..ac96a0b63 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"
@@ -253,6 +254,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 (IsBridgeAbove(tile)) {
int bridge_height = GetBridgeHeight(GetSouthernBridgeEnd(tile));