diff options
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r-- | src/unmovable_cmd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index c3495d715..8bc8f3fa1 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -24,6 +24,7 @@ #include "table/unmovable_land.h" #include "genworld.h" #include "bridge.h" +#include "autoslope.h" /** Destroy a HQ. * During normal gameplay you can only implicitely destroy a HQ when you are @@ -408,6 +409,10 @@ static CommandCost TerraformTile_Unmovable(TileIndex tile, uint32 flags, uint z_ /* Owned land remains unsold */ if (IsOwnedLand(tile) && CheckTileOwnership(tile)) return CommandCost(); + if (AutoslopeEnabled() && (IsStatue(tile) || IsCompanyHQ(tile))) { + if (!IsSteepSlope(tileh_new) && (z_new + GetSlopeMaxZ(tileh_new) == GetTileMaxZ(tile))) return _price.terraform; + } + return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); } |